libexif/libexif-remove-safety.diff

21 lines
669 B
Diff

--- libexif/exif-data.c 2008-03-17 08:22:12.755318000 +0100
+++ libexif/exif-data.c 2008-04-28 10:45:27.000000000 +0200
@@ -1219,8 +1219,16 @@
exif_log (c->parent->priv->log, EXIF_LOG_CODE_DEBUG, "exif-data",
"No thumbnail but entries on thumbnail. These entries have been "
"removed.");
- while (c->count)
+ while (c->count) {
+ int cnt = c->count;
exif_content_remove_entry (c, c->entries[c->count - 1]);
+ if (cnt == c->count) {
+ /* safety net */
+ exif_log (c->parent->priv->log, EXIF_LOG_CODE_DEBUG, "exif-data",
+ "failed to remove last entry from entries.");
+ c->count--;
+ }
+ }
}
break;
default: