aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-07-06 11:51:09 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2020-01-06 11:30:42 +0100
commitcacf998071dcf6f780bc8c8ca05c96adbecd2339 (patch)
tree1c3ac1787aabe35bbc4568b07a2af71110f9d96c /libavcodec
parent01f9c1540ae8c56ab67200a3e6ec471e3b5febb4 (diff)
downloadffmpeg-cacf998071dcf6f780bc8c8ca05c96adbecd2339.tar.gz
avcodec/dnxhd_parser: Fix parser when input does not have nicely sized packets
Fixes: out of array access Fixes: 15522/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DNXHD_fuzzer-5747756078989312 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 2d900d8fe0aaf9c984e024956eb537ecdfe2c949) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/dnxhd_parser.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/dnxhd_parser.c b/libavcodec/dnxhd_parser.c
index f657af8f41..67a717db62 100644
--- a/libavcodec/dnxhd_parser.c
+++ b/libavcodec/dnxhd_parser.c
@@ -79,8 +79,9 @@ static int dnxhd_find_frame_end(DNXHDParserContext *dctx,
if (remaining <= 0)
continue;
}
+ remaining += i - 47;
dctx->remaining = remaining;
- if (buf_size - i + 47 >= dctx->remaining) {
+ if (buf_size >= dctx->remaining) {
pc->frame_start_found = 0;
pc->state64 = -1;
dctx->cur_byte = 0;