Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(873)

Unified Diff: libexif/exif-data.c

Issue 1583893003: libexif: exif_data_load_data_content() should not recurse with the same offset. (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libexif/sources.git@master
Patch Set: rebase Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: libexif/exif-data.c
diff --git a/libexif/exif-data.c b/libexif/exif-data.c
index 67df4db2bec0547ad8758c997c834bc6f7f69669..e33d69647440c41a1aea6b28b3d5f1bb5c645900 100644
--- a/libexif/exif-data.c
+++ b/libexif/exif-data.c
@@ -364,6 +364,7 @@ exif_data_load_data_content (ExifData *data, ExifIfd ifd,
ExifEntry *entry;
unsigned int i;
ExifTag tag;
+ const unsigned int original_offset = offset;
if (!data || !data->priv)
return;
@@ -416,14 +417,20 @@ exif_data_load_data_content (ExifData *data, ExifIfd ifd,
switch (tag) {
case EXIF_TAG_EXIF_IFD_POINTER:
CHECK_REC (EXIF_IFD_EXIF);
+ if (o == original_offset)
+ return;
exif_data_load_data_content (data, EXIF_IFD_EXIF, d, ds, o, recursion_depth + 1);
break;
case EXIF_TAG_GPS_INFO_IFD_POINTER:
CHECK_REC (EXIF_IFD_GPS);
+ if (o == original_offset)
+ return;
exif_data_load_data_content (data, EXIF_IFD_GPS, d, ds, o, recursion_depth + 1);
break;
case EXIF_TAG_INTEROPERABILITY_IFD_POINTER:
CHECK_REC (EXIF_IFD_INTEROPERABILITY);
+ if (o == original_offset)
+ return;
exif_data_load_data_content (data, EXIF_IFD_INTEROPERABILITY, d, ds, o, recursion_depth + 1);
break;
case EXIF_TAG_JPEG_INTERCHANGE_FORMAT:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698