Fixes: assertion failure Fixes: 19286/clusterfuzz-testcase-minimized-ffmpeg_BSF_H264_REDUNDANT_PPS_fuzzer-5707990724509696
Unified · Split
| @@ -568,7 +568,10 @@ static int cbs_h2645_fragment_add_nals(CodedBitstreamContext *ctx, · 567 unmodified lines | ||
| 568 | 568 | // Remove trailing zeroes. |
| 569 | 569 | while (size > 0 && nal->data[size - 1] == 0) |
| 570 | 570 | --size; |
| 571 | − av_assert0(size > 0); | |
| 571 | + if (size == 0) { | |
| 572 | + av_log(ctx->log_ctx, AV_LOG_VERBOSE, "Discarding empty 0 NAL unit\n"); | |
| 573 | + continue; | |
| 574 | + } | |
| 572 | 575 | |
| 573 | 576 | ref = (nal->data == nal->raw_data) ? frag->data_ref |
| 574 | 577 | : packet->rbsp.rbsp_buffer_ref; |