Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2019-11-11 03:08:37 +0300
committerJames Almer <jamrial@gmail.com>2019-11-13 04:04:29 +0300
commit245cbab556b88e5bd900da6708e7fe196b7ad8e5 (patch)
treebdfa14f490625d967eddfc855a162b2dae558a3c /libavcodec/cbs_av1.c
parent08c46e40fb680b7d8b5b2d356757c7a164f27d57 (diff)
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>
Diffstat (limited to 'libavcodec/cbs_av1.c')
-rw-r--r--libavcodec/cbs_av1.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/libavcodec/cbs_av1.c b/libavcodec/cbs_av1.c
index c027933218..cca112ecf8 100644
--- a/libavcodec/cbs_av1.c
+++ b/libavcodec/cbs_av1.c
@@ -768,14 +768,13 @@ static int cbs_av1_split_fragment(CodedBitstreamContext *ctx,
if (err < 0)
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 (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);
if (err < 0)
goto fail;