Skip to content

Commit 0a0942b

Browse files
committed
-comments
#just another jhead.c line
1 parent adf31e9 commit 0a0942b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

ext/exif/exif.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1470,7 +1470,7 @@ static void exif_process_IFD_in_JPEG(image_info_type *ImageInfo, char *DirStart,
14701470
NumDirEntries = php_ifd_get16u(DirStart, ImageInfo->motorola_intel);
14711471

14721472
if ((DirStart+2+NumDirEntries*12) > (OffsetBase+IFDlength)) {
1473-
php_error(E_WARNING, "Illegally sized directory");
1473+
php_error(E_WARNING, "Illegally sized directory x%04X + 2 + x%04X*12 = x%04X > x%04X", (int)DirStart+2-(int)OffsetBase, NumDirEntries, (int)DirStart+2+NumDirEntries*12-(int)OffsetBase, IFDlength);
14741474
return;
14751475
}
14761476

@@ -1546,6 +1546,9 @@ static void exif_process_APP1(image_info_type *ImageInfo, char *CharBuf, unsigne
15461546
return;
15471547
}
15481548
exif_process_TIFF_in_JPEG(ImageInfo,CharBuf+8,length-8);
1549+
#ifdef EXIF_DEBUG
1550+
php_error(E_NOTICE,"process Exif done");
1551+
#endif
15491552
}
15501553
/* }}} */
15511554

@@ -1679,8 +1682,8 @@ static int exif_scan_JPEG_header(image_info_type *ImageInfo, FILE *infile)
16791682
break;
16801683

16811684
case M_EXIF:
1682-
ImageInfo->sections_found |= FOUND_EXIF;
1683-
if (ImageInfo->sections_count <= 2) {
1685+
if ( !(ImageInfo->sections_found&FOUND_EXIF)) {
1686+
ImageInfo->sections_found |= FOUND_EXIF;
16841687
/* Seen files from some 'U-lead' software with Vivitar scanner
16851688
that uses marker 31 later in the file (no clue what for!) */
16861689
exif_process_APP1(ImageInfo, (char *)Data, itemlen);

0 commit comments

Comments
 (0)