diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-12-26 02:57:07 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-12-26 18:06:25 +0300 |
commit | 4fa2d5a692f40c398a299acf2c6a20f5b98a3708 (patch) | |
tree | a6a1901a0f68c4942e4551919e67dfd35a883564 /libavcodec/cbs_vp9.c | |
parent | 398a5f5d8ffe3c39b320c2e5584beba26c99b2ff (diff) |
avcodec/cbs_vp9: Check data_size
Fixes: out of array access
Fixes: 19542/clusterfuzz-testcase-minimized-ffmpeg_BSF_TRACE_HEADERS_fuzzer-5659498341728256
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/cbs_vp9.c')
-rw-r--r-- | libavcodec/cbs_vp9.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/cbs_vp9.c b/libavcodec/cbs_vp9.c index 98730e03e3..ec82f11c76 100644 --- a/libavcodec/cbs_vp9.c +++ b/libavcodec/cbs_vp9.c @@ -416,6 +416,9 @@ static int cbs_vp9_split_fragment(CodedBitstreamContext *ctx, uint8_t superframe_header; int err; + if (frag->data_size == 0) + return AVERROR_INVALIDDATA; + // Last byte in the packet. superframe_header = frag->data[frag->data_size - 1]; |