prevent /0 in jfif res decode

This commit is contained in:
John Cupitt 2020-05-06 20:08:36 +01:00
parent a2cd5215f1
commit b9eddecca3
1 changed files with 3 additions and 1 deletions

View File

@ -524,7 +524,9 @@ read_jpeg_header( ReadJpeg *jpeg, VipsImage *out )
/* X_density / Y_density gives the pixel aspect ratio.
* Leave xres, but adjust yres.
*/
yres = xres * cinfo->X_density / cinfo->Y_density;
if( cinfo->Y_density > 0 )
yres = xres * cinfo->X_density /
cinfo->Y_density;
break;
case 1: