mirror of https://git.ffmpeg.org/ffmpeg.git
avcodec/cbs_h2645: Remove always-false check
The functions to replace parameter sets are only called after the respective parameter set has just been read or has just been written; all of these functions check that the id field is within the appropriate range. So the checks in the replace-functions can be removed. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
parent
2ba04bafb4
commit
0d408f4013
|
@ -666,13 +666,7 @@ static int cbs_h26 ## h26n ## _replace_ ## ps_var(CodedBitstreamContext *ctx, \
|
||||||
CodedBitstreamH26 ## h26n ## Context *priv = ctx->priv_data; \
|
CodedBitstreamH26 ## h26n ## Context *priv = ctx->priv_data; \
|
||||||
H26 ## h26n ## Raw ## ps_name *ps_var = unit->content; \
|
H26 ## h26n ## Raw ## ps_name *ps_var = unit->content; \
|
||||||
unsigned int id = ps_var->id_element; \
|
unsigned int id = ps_var->id_element; \
|
||||||
int err; \
|
int err = ff_cbs_make_unit_refcounted(ctx, unit); \
|
||||||
if (id >= FF_ARRAY_ELEMS(priv->ps_var)) { \
|
|
||||||
av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid " #ps_name \
|
|
||||||
" id : %d.\n", id); \
|
|
||||||
return AVERROR_INVALIDDATA; \
|
|
||||||
} \
|
|
||||||
err = ff_cbs_make_unit_refcounted(ctx, unit); \
|
|
||||||
if (err < 0) \
|
if (err < 0) \
|
||||||
return err; \
|
return err; \
|
||||||
if (priv->ps_var[id] == priv->active_ ## ps_var) \
|
if (priv->ps_var[id] == priv->active_ ## ps_var) \
|
||||||
|
|
Loading…
Reference in New Issue