JamesHeinrich / getID3

http://www.getid3.org/
Other
1.16k stars 246 forks source link

`fread` length error in XMP #418

Closed zerocrates closed 1 year ago

zerocrates commented 1 year ago

Encountering an erroring 0-length read from fread when processing a JPEG:

[08-Aug-2023 14:45:00 UTC] PHP Fatal error:  Uncaught ValueError: fread(): Argument #2 ($length) must be greater than 0 in /var/www/webroot/ROOT/application/libraries/getid3/module.tag.xmp.php:149
Stack trace:
#0 /var/www/webroot/ROOT/application/libraries/getid3/module.tag.xmp.php(149): fread(Resource id #309, 0)
#1 /var/www/webroot/ROOT/application/libraries/getid3/module.tag.xmp.php(201): Image_XMP->_get_jpeg_header_data('/tmp/phpsVb4ti')
#2 /var/www/webroot/ROOT/application/libraries/getid3/module.tag.xmp.php(415): Image_XMP->_get_XMP_text('/tmp/phpsVb4ti')
#3 /var/www/webroot/ROOT/application/libraries/getid3/module.graphic.jpg.php(163): Image_XMP->__construct('/tmp/phpsVb4ti')
#4 /var/www/webroot/ROOT/application/libraries/getid3/getid3.php(778): getid3_jpg->Analyze()

I can share the triggering image but would rather not post it in the issue.

zerocrates commented 1 year ago

I sent the file to the info email address.

JamesHeinrich commented 1 year ago

Thanks for the sample file, fixed in https://github.com/JamesHeinrich/getID3/commit/cba30f64f36ec2c3ca78408a15c398d84f55d4bb