mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-08 13:22:53 +02:00
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>
(cherry picked from commit ef13fafe22
)
This commit is contained in:
parent
cdf88b5a0c
commit
e6ab99f324
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user