diff options
author | Felipe Pena <felipensp@gmail.com> | 2012-06-03 19:01:50 -0300 |
---|---|---|
committer | Felipe Pena <felipensp@gmail.com> | 2012-06-03 19:01:50 -0300 |
commit | 8779a9aad572618ce8aa94fc21479b63c471fef1 (patch) | |
tree | ebb8d1e3c3ecb1e5576cc56e1ac9e89f6129de8c /ext/exif | |
parent | 60c5f9910fbc5bd21fca8a624c6486ad8a41273a (diff) | |
parent | e59b6dc0ae803d49c3f620818285f98dfb61fd57 (diff) | |
download | php-git-8779a9aad572618ce8aa94fc21479b63c471fef1.tar.gz |
Merge commit 'e59b6dc0ae803d49c3f620818285f98dfb61fd57' into PHP-5.4
Diffstat (limited to 'ext/exif')
-rw-r--r-- | ext/exif/exif.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/exif/exif.c b/ext/exif/exif.c index b490ded55e..9db6674742 100644 --- a/ext/exif/exif.c +++ b/ext/exif/exif.c @@ -3254,7 +3254,7 @@ static void exif_process_APP12(image_info_type *ImageInfo, char *buffer, size_t if ((l1 = php_strnlen(buffer+2, length-2)) > 0) { exif_iif_add_tag(ImageInfo, SECTION_APP12, "Company", TAG_NONE, TAG_FMT_STRING, l1, buffer+2 TSRMLS_CC); if (length > 2+l1+1) { - l2 = php_strnlen(buffer+2+l1+1, length-2-l1+1); + l2 = php_strnlen(buffer+2+l1+1, length-2-l1-1); exif_iif_add_tag(ImageInfo, SECTION_APP12, "Info", TAG_NONE, TAG_FMT_STRING, l2, buffer+2+l1+1 TSRMLS_CC); } } @@ -3404,6 +3404,10 @@ static int exif_scan_JPEG_header(image_info_type *ImageInfo TSRMLS_DC) case M_SOF13: case M_SOF14: case M_SOF15: + if ((itemlen - 2) < 6) { + return FALSE; + } + exif_process_SOFn(Data, marker, &sof_info); ImageInfo->Width = sof_info.width; ImageInfo->Height = sof_info.height; |