We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1b97b52 commit 9713a71Copy full SHA for 9713a71
libvips/foreign/exif.c
@@ -464,8 +464,10 @@ vips_image_resolution_from_exif( VipsImage *image, ExifData *ed )
464
"seen exif resolution %g, %g p/mm\n", xres, yres );
465
#endif /*DEBUG*/
466
467
- image->Xres = xres;
468
- image->Yres = yres;
+ /* Don't allow negative resolution.
+ */
469
+ image->Xres = VIPS_MAX( 0, xres );
470
+ image->Yres = VIPS_MAX( 0, yres );
471
472
return( 0 );
473
}
libvips/iofuncs/header.c
@@ -1014,8 +1014,8 @@ vips_image_init_fields( VipsImage *image,
1014
1015
image->Coding = coding;
1016
image->Type = interpretation;
1017
1018
1019
1020
1021
static void *
0 commit comments