summaryrefslogtreecommitdiff
path: root/libavcodec/cbs_h2645.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2020-06-11 13:06:10 -0300
committerJames Almer <jamrial@gmail.com>2020-06-14 16:42:04 -0300
commitef13fafe229a86480305fbb05e83208102ea962f (patch)
treee81f8c2d60eb9577092d79e057f7e057255562a3 /libavcodec/cbs_h2645.c
parent0aa2768cb275bda9e9e1331ed95adc7cd686eafe (diff)
avcodec/cbs_h2645: abort when written inferred values don't match
If this happens, it's a sign of parsing issues earlier in the process, or misuse by the calling module. Prevents writing invalid bitstreams. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/cbs_h2645.c')
-rw-r--r--libavcodec/cbs_h2645.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/cbs_h2645.c b/libavcodec/cbs_h2645.c
index b432921ecc..64fe2c1b9b 100644
--- a/libavcodec/cbs_h2645.c
+++ b/libavcodec/cbs_h2645.c
@@ -408,10 +408,11 @@ static int cbs_h2645_read_more_rbsp_data(GetBitContext *gbc)
#define infer(name, value) do { \
if (current->name != (value)) { \
- av_log(ctx->log_ctx, AV_LOG_WARNING, "Warning: " \
+ av_log(ctx->log_ctx, AV_LOG_ERROR, \
"%s does not match inferred value: " \
"%"PRId64", but should be %"PRId64".\n", \
#name, (int64_t)current->name, (int64_t)(value)); \
+ return AVERROR_INVALIDDATA; \
} \
} while (0)