aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-06-11 01:05:26 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-06-16 01:05:30 +0200
commit722cbfc5e163d2ecf9339f262c4cf354c20c371d (patch)
treece7b213d44ed32c4ff94a5d272f4bd21baf8e63b
parent9a8419541f2b91b1d88425042cc4b69bf1f415bf (diff)
downloadffmpeg-722cbfc5e163d2ecf9339f262c4cf354c20c371d.tar.gz
avcodec/tiff: Fix leak of geotags[].val
Fixes: 2176/clusterfuzz-testcase-minimized-5908197216878592 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 22a25ab3896cbb8dceebdba4d439e8b2b398ff0e) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/tiff.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index e73ddb54a9..da0a5353a0 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -1097,6 +1097,8 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
if (s->geotags[i].count == 0
|| s->geotags[i].offset + s->geotags[i].count > count) {
av_log(s->avctx, AV_LOG_WARNING, "Invalid GeoTIFF key %d\n", s->geotags[i].key);
+ } else if (s->geotags[i].val) {
+ av_log(s->avctx, AV_LOG_WARNING, "Duplicate GeoTIFF key %d\n", s->geotags[i].key);
} else {
char *ap = doubles2str(&dp[s->geotags[i].offset], s->geotags[i].count, ", ");
if (!ap) {