Wrapped frames contain pointers so they need specific code to
noise them, the generic code would lead to segfaults

Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>
---
 libavcodec/noise_bsf.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libavcodec/noise_bsf.c b/libavcodec/noise_bsf.c
index 168f3aa373..2985a8ec4f 100644
--- a/libavcodec/noise_bsf.c
+++ b/libavcodec/noise_bsf.c
@@ -86,6 +86,13 @@ 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) {
-- 
2.17.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to