aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-12-11 19:19:49 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2020-05-19 17:17:35 +0200
commit2ac4b4fde507e60e4232d2cf3a8d1bf977186220 (patch)
treed2281a49f0dd97506bb21216fdc759713b1012a7
parenta641bd4ad76777255ddce40a13f604f9996d9645 (diff)
downloadffmpeg-2ac4b4fde507e60e4232d2cf3a8d1bf977186220.tar.gz
avcodec/cbs_h2645: Skip all 0 NAL units
Fixes: assertion failure Fixes: 19286/clusterfuzz-testcase-minimized-ffmpeg_BSF_H264_REDUNDANT_PPS_fuzzer-5707990724509696 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 285138ef14327ec71f356e3a923c4adde0874dc6) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/cbs_h2645.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/cbs_h2645.c b/libavcodec/cbs_h2645.c
index 1964ccf766..3fed343c02 100644
--- a/libavcodec/cbs_h2645.c
+++ b/libavcodec/cbs_h2645.c
@@ -568,7 +568,10 @@ static int cbs_h2645_fragment_add_nals(CodedBitstreamContext *ctx,
// Remove trailing zeroes.
while (size > 0 && nal->data[size - 1] == 0)
--size;
- av_assert0(size > 0);
+ if (size == 0) {
+ av_log(ctx->log_ctx, AV_LOG_VERBOSE, "Discarding empty 0 NAL unit\n");
+ continue;
+ }
ref = (nal->data == nal->raw_data) ? frag->data_ref
: packet->rbsp.rbsp_buffer_ref;