[gimp] file-jpeg: Validate ExifRational.denominator before division



commit 94fa7a04713cf9d826e95f5eca49f88e7930dbdb
Author: Mukund Sivaraman <muks banu com>
Date:   Fri Mar 18 03:44:08 2011 +0530

    file-jpeg: Validate ExifRational.denominator before division

 plug-ins/file-jpeg/jpeg-exif.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/plug-ins/file-jpeg/jpeg-exif.c b/plug-ins/file-jpeg/jpeg-exif.c
index a1f8879..fac2a0d 100644
--- a/plug-ins/file-jpeg/jpeg-exif.c
+++ b/plug-ins/file-jpeg/jpeg-exif.c
@@ -124,6 +124,8 @@ jpeg_exif_get_resolution (ExifData *exif_data,
         break;
 
       r = exif_get_rational (entry->data, byte_order);
+      if (r.denominator == 0.0)
+        break;
       xres = r.numerator / r.denominator;
 
       entry = exif_content_get_entry (exif_data->ifd[EXIF_IFD_0],
@@ -132,6 +134,8 @@ jpeg_exif_get_resolution (ExifData *exif_data,
         break;
 
       r = exif_get_rational (entry->data, byte_order);
+      if (r.denominator == 0.0)
+        break;
       yres = r.numerator / r.denominator;
 
       entry = exif_content_get_entry (exif_data->ifd[EXIF_IFD_0],



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]