summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <[email protected]>2017-03-13 20:45:08 +0100
committerMichael Niedermayer <[email protected]>2017-05-16 16:00:22 +0200
commit139a5390623b01453ce6fe9aab913200844a25a9 (patch)
treeb19b1d67505a631a263818e925b4b27eb66d0551
parentbafec54a93288a534c2fd8d4a6debbfab425a769 (diff)
avcodec/tiff: Check for multiple geo key directories
Fixes memleak Fixes: 826/clusterfuzz-testcase-5316921379520512 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <[email protected]> (cherry picked from commit 108b02e5471c1dae248200db694aba9b7b8555a8) Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r--libavcodec/tiff.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 4be587d569..ecafd2ddf1 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -1035,6 +1035,10 @@ static int tiff_decode_tag(TiffContext *s, AVFrame *frame)
ADD_METADATA(count, "ModelTiepointTag", NULL);
break;
case TIFF_GEO_KEY_DIRECTORY:
+ if (s->geotag_count) {
+ avpriv_request_sample(s->avctx, "Multiple geo key directories\n");
+ return AVERROR_INVALIDDATA;
+ }
ADD_METADATA(1, "GeoTIFF_Version", NULL);
ADD_METADATA(2, "GeoTIFF_Key_Revision", ".");
s->geotag_count = ff_tget_short(&s->gb, s->le);