[FFmpeg-devel] [PATCH 3/6] avcodec/tiff: Don't check before av_freep()

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Sun Mar 10 16:15:01 EET 2024


Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
 libavcodec/tiff.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index afa1289e27..5d350f4e7e 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -132,11 +132,8 @@ static void tiff_set_type(TiffContext *s, enum TiffType tiff_type) {
 
 static void free_geotags(TiffContext *const s)
 {
-    int i;
-    for (i = 0; i < s->geotag_count; i++) {
-        if (s->geotags[i].val)
-            av_freep(&s->geotags[i].val);
-    }
+    for (int i = 0; i < s->geotag_count; i++)
+        av_freep(&s->geotags[i].val);
     av_freep(&s->geotags);
     s->geotag_count = 0;
 }
-- 
2.40.1



More information about the ffmpeg-devel mailing list