mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-21 23:10:13 +00:00
avcodec/cbs_av1: support one byte long OBUs when the size is not set in the bitstream
This will be needed by the next commit, where packets with a single Temporal Delimiter OBU with no size will need to be parsed Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
08c46e40fb
commit
245cbab556
@ -768,14 +768,13 @@ static int cbs_av1_split_fragment(CodedBitstreamContext *ctx,
|
|||||||
if (err < 0)
|
if (err < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
if (get_bits_left(&gbc) < 8) {
|
|
||||||
av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid OBU: fragment "
|
|
||||||
"too short (%"SIZE_SPECIFIER" bytes).\n", size);
|
|
||||||
err = AVERROR_INVALIDDATA;
|
|
||||||
goto fail;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (header.obu_has_size_field) {
|
if (header.obu_has_size_field) {
|
||||||
|
if (get_bits_left(&gbc) < 8) {
|
||||||
|
av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid OBU: fragment "
|
||||||
|
"too short (%"SIZE_SPECIFIER" bytes).\n", size);
|
||||||
|
err = AVERROR_INVALIDDATA;
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
err = cbs_av1_read_leb128(ctx, &gbc, "obu_size", &obu_size);
|
err = cbs_av1_read_leb128(ctx, &gbc, "obu_size", &obu_size);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
Loading…
Reference in New Issue
Block a user