diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2023-06-04 19:59:40 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2023-06-06 21:38:02 +0200 |
commit | 0889ebc577749ee6abc620bc9030d2002487935f (patch) | |
tree | f3c49821c8ebc9a806d95f0af8cedc0760a0d00f | |
parent | 8d5de4e12f1554575d7cddf7438e36aff352e197 (diff) | |
download | ffmpeg-0889ebc577749ee6abc620bc9030d2002487935f.tar.gz |
avcodec/noise_bsf: Check for wrapped frames
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>
-rw-r--r-- | libavcodec/noise_bsf.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/noise_bsf.c b/libavcodec/noise_bsf.c index 168f3aa373..7bdaa3c1db 100644 --- a/libavcodec/noise_bsf.c +++ b/libavcodec/noise_bsf.c @@ -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) { |