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>2020-04-19 19:24:55 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2020-04-23 20:30:07 +0300
commitae2537f53e8ebfa36345241b5b70c0b1aef66dd2 (patch)
treee299f4c7b29d3bbe0d51e14ff8b044bf365e0852 /libavcodec/hevc_mp4toannexb_bsf.c
parente58766ba12bc86f54af1d8078cbe02f45b1686aa (diff)
avcodec/hevc_mp4toannexb_bsf: Check nalu_size
Fixes: Timeout (29sec -> 5ms) Fixes: 20237/clusterfuzz-testcase-minimized-ffmpeg_BSF_HEVC_MP4TOANNEXB_fuzzer-5165615044362240 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/hevc_mp4toannexb_bsf.c')
-rw-r--r--libavcodec/hevc_mp4toannexb_bsf.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/hevc_mp4toannexb_bsf.c b/libavcodec/hevc_mp4toannexb_bsf.c
index baa93628ed..30f733d775 100644
--- a/libavcodec/hevc_mp4toannexb_bsf.c
+++ b/libavcodec/hevc_mp4toannexb_bsf.c
@@ -144,6 +144,11 @@ static int hevc_mp4toannexb_filter(AVBSFContext *ctx, AVPacket *out)
for (i = 0; i < s->length_size; i++)
nalu_size = (nalu_size << 8) | bytestream2_get_byte(&gb);
+ if (nalu_size < 2) {
+ ret = AVERROR_INVALIDDATA;
+ goto fail;
+ }
+
nalu_type = (bytestream2_peek_byte(&gb) >> 1) & 0x3f;
/* prepend extradata to IRAP frames */