From 372cb2113aaecbc75ef9e2b17fe0e4b485bd1b9a Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 18 May 2008 23:02:19 +0000 Subject: [PATCH] fix to prev --- harbour/contrib/hbhpdf/harupdf.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/harbour/contrib/hbhpdf/harupdf.c b/harbour/contrib/hbhpdf/harupdf.c index 82c7f6cb57..fb044b473e 100644 --- a/harbour/contrib/hbhpdf/harupdf.c +++ b/harbour/contrib/hbhpdf/harupdf.c @@ -169,7 +169,12 @@ HB_FUNC( HPDF_GETSTREAMSIZE ) HB_FUNC( HPDF_READFROMSTREAM ) { HPDF_UINT32 size = hb_parclen( 2 ); - HPDF_BYTE * buffer = ( HPDF_BYTE * ) hb_xgrab( size ); + HPDF_BYTE * buffer; + + if( size < 1024 ) + size = 1024; + + buffer = ( HPDF_BYTE * ) hb_xgrab( size ); hb_retnl( (long) HPDF_ReadFromStream( HPDF_Doc_par( 1 ), buffer, &size ) );