Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-06-05 21:39:21 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2017-06-16 02:05:29 +0300
commit260a286e5308ce9e6e4585aa7347194d34e2cc19 (patch)
tree873bc45bc3de6fe6c2dcd70b461b2e8ad369c85c
parentfb0d1cafab1df3e6e34124dda19cd94a8f43298b (diff)
avcodec/tiff: Avoid loosing allocated geotag values
Fixes memleak Fixes: 2076/clusterfuzz-testcase-minimized-6542640243802112 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 d7cbeab4c1381f95ed0ebf85d7950bee96f66164) 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 a0f4bff5cf..e73ddb54a9 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -1123,6 +1123,8 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
bytestream2_seek(&s->gb, pos + s->geotags[i].offset, SEEK_SET);
if (bytestream2_get_bytes_left(&s->gb) < s->geotags[i].count)
return AVERROR_INVALIDDATA;
+ if (s->geotags[i].val)
+ return AVERROR_INVALIDDATA;
ap = av_malloc(s->geotags[i].count);
if (!ap) {
av_log(s->avctx, AV_LOG_ERROR, "Error allocating temporary buffer\n");