cvs: php4(PHP_4_2_0) /ext/exif exif.c

From: Date: Sun, 19 May 2002 00:03:41 +0000
Subject: cvs: php4(PHP_4_2_0) /ext/exif exif.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-11993@lists.php.net to get a copy of this message
sniper Sat May 18 20:03:41 2002 EDT Modified files: (Branch: PHP_4_2_0) /php4/ext/exif exif.c Log: MFH Index: php4/ext/exif/exif.c diff -u php4/ext/exif/exif.c:1.52.2.7 php4/ext/exif/exif.c:1.52.2.8 --- php4/ext/exif/exif.c:1.52.2.7 Wed Apr 10 02:37:49 2002 +++ php4/ext/exif/exif.c Sat May 18 20:03:34 2002 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: exif.c,v 1.52.2.7 2002/04/10 06:37:49 derick Exp $ */ +/* $Id: exif.c,v 1.52.2.8 2002/05/19 00:03:34 sniper Exp $ */ /* ToDos * @@ -1340,9 +1340,11 @@ /* If its bigger than 4 bytes, the dir entry contains an offset. */ value_ptr = offset_base+offset_val; if (offset_val+byte_count > IFDlength || value_ptr < dir_entry) { + /* // It is important to check for IMAGE_FILETYPE_TIFF // JPEG does not use absolute pointers instead its pointers are relative to the start // of the TIFF header in APP1 section. + */ if (offset_val<0 || offset_val+byte_count>ImageInfo->FileSize || (ImageInfo->FileType!=IMAGE_FILETYPE_TIFF_II && ImageInfo->FileType!=IMAGE_FILETYPE_TIFF_MM)) { if (value_ptr < dir_entry) { /* we can read this if offset_val > 0 */ @@ -1356,7 +1358,7 @@ return; } if ( byte_count>sizeof(cbuf)) { - // mark as outside range and get buffer + /* mark as outside range and get buffer */ value_ptr = emalloc(byte_count); if ( !value_ptr) { php_error(E_WARNING, "could not allocate data for entire image"); @@ -1364,11 +1366,13 @@ } outside = value_ptr; } else { + /* // in most cases we only access a small range so // it is faster to use a static buffer there // BUT it offers also the possibility to have // pointers read without the need to free them // explicitley before returning. + */ value_ptr = cbuf; } fpos = ftell(ImageInfo->infile);

« previous php.cvs (#11993) next »