[FFmpeg-cvslog] avcodec/noise_bsf: Check for wrapped frames

Michael Niedermayer git at videolan.org
Sun Apr 14 23:23:09 EEST 2024


ffmpeg | branch: release/4.2 | Michael Niedermayer <michael at niedermayer.cc> | Sun Jun  4 19:59:40 2023 +0200| [1658316c8327f945c49dd4537d43bd7607dd4c37] | committer: Michael Niedermayer

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 at niedermayer.cc>
(cherry picked from commit 0889ebc577749ee6abc620bc9030d2002487935f)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1658316c8327f945c49dd4537d43bd7607dd4c37
---

 libavcodec/noise_bsf.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/noise_bsf.c b/libavcodec/noise_bsf.c
index d79f63b777..42533c6df9 100644
--- a/libavcodec/noise_bsf.c
+++ b/libavcodec/noise_bsf.c
@@ -44,6 +44,11 @@ static int noise(AVBSFContext *ctx, AVPacket *pkt)
     if (amount <= 0)
         return AVERROR(EINVAL);
 
+    if (ctx->par_in->codec_id == AV_CODEC_ID_WRAPPED_AVFRAME) {
+        av_log(ctx, AV_LOG_ERROR, "Wrapped AVFrame noising is unsupported\n");
+        return AVERROR_PATCHWELCOME;
+    }
+
     ret = ff_bsf_get_packet_ref(ctx, pkt);
     if (ret < 0)
         return ret;



More information about the ffmpeg-cvslog mailing list