Skip to content

Commit

Permalink
avcodec/noise_bsf: Check for wrapped frames
Browse files Browse the repository at this point in the history
Wrapped frames contain pointers so they need specific code to
noise them, the generic code would lead to segfaults

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
  • Loading branch information
michaelni committed Jun 6, 2023
1 parent 8d5de4e commit 0889ebc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions libavcodec/noise_bsf.c
Expand Up @@ -86,6 +86,12 @@ static int noise_init(AVBSFContext *ctx)
return AVERROR(ENOMEM);
}

if (ctx->par_in->codec_id == AV_CODEC_ID_WRAPPED_AVFRAME &&
strcmp(s->amount_str, "0")) {
av_log(ctx, AV_LOG_ERROR, "Wrapped AVFrame noising is unsupported\n");
return AVERROR_PATCHWELCOME;
}

ret = av_expr_parse(&s->amount_pexpr, s->amount_str,
var_names, NULL, NULL, NULL, NULL, 0, ctx);
if (ret < 0) {
Expand Down

0 comments on commit 0889ebc

Please sign in to comment.