aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-04-16 22:29:09 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2018-06-18 01:16:03 +0200
commitf93d7a0c0a233fc5992092b5764d83f3f96077d0 (patch)
tree55eb9e5230690b81f84406c4ac88f58a91e42133
parent81d8bd6f421b6f48447198d7ed4d4f2f9a4ae2d5 (diff)
downloadffmpeg-f93d7a0c0a233fc5992092b5764d83f3f96077d0.tar.gz
avcodec/dsicinvideo: Fail if there is only a small fraction of the data available that comprises a full frame
Fixes: Timeout Fixes: 6306/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DSICINVIDEO_fuzzer-5079253549842432 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 5549488bbf3a23c0fb9833cefc6354f97055dd96) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/dsicinvideo.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/dsicinvideo.c b/libavcodec/dsicinvideo.c
index add7afa383..aa080417d2 100644
--- a/libavcodec/dsicinvideo.c
+++ b/libavcodec/dsicinvideo.c
@@ -158,6 +158,9 @@ static int cin_decode_lzss(const unsigned char *src, int src_size,
}
}
+ if (dst_end - dst > dst_size - dst_size/10)
+ return AVERROR_INVALIDDATA;
+
return 0;
}
@@ -184,6 +187,10 @@ static int cin_decode_rle(const unsigned char *src, int src_size,
}
dst += len;
}
+
+ if (dst_end - dst > dst_size - dst_size/10)
+ return AVERROR_INVALIDDATA;
+
return 0;
}