[FFmpeg-cvslog] avcodec/tiff: Don't check before av_freep()

Andreas Rheinhardt git at videolan.org
Tue Mar 12 15:52:05 EET 2024


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Sat Mar  9 14:31:07 2024 +0100| [f6f94c335765b379aaaa4ee0de10c20b8632746f] | committer: Andreas Rheinhardt

avcodec/tiff: Don't check before av_freep()

Reviewed-by: Stefano Sabatini <stefasab at gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f6f94c335765b379aaaa4ee0de10c20b8632746f
---

 libavcodec/tiff.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index c45fd34dbc..6a0f8ee1e7 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;
 }



More information about the ffmpeg-cvslog mailing list