Commit 66bdf8f1 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/dsicinvideo: Fail if there is only a small fraction of the data…

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/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 5549488b)
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent bfe61bbd
...@@ -158,6 +158,9 @@ static int cin_decode_lzss(const unsigned char *src, int src_size, ...@@ -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; return 0;
} }
...@@ -184,6 +187,10 @@ static int cin_decode_rle(const unsigned char *src, int src_size, ...@@ -184,6 +187,10 @@ static int cin_decode_rle(const unsigned char *src, int src_size,
} }
dst += len; dst += len;
} }
if (dst_end - dst > dst_size - dst_size/10)
return AVERROR_INVALIDDATA;
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment