[FFmpeg-cvslog] avcodec/opus: don't materialize buf pointer from null

Kacper Michajłow git at videolan.org
Mon Aug 4 19:37:41 EEST 2025


ffmpeg | branch: release/6.1 | Kacper Michajłow <kasper93 at gmail.com> | Thu Jul  3 23:08:23 2025 +0200| [dc69bed43a2ab028f1a007b416ab49cac44a4fdd] | committer: Michael Niedermayer

avcodec/opus: don't materialize buf pointer from null

Fixes: avcodec/opus/dec.c: runtime error: applying non-zero offset 10 to null pointer

Signed-off-by: Kacper Michajłow <kasper93 at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 3b6ec5abb5fb3cffdfcd25f834c43e53cab2cabe)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavcodec/opusdec.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/opusdec.c b/libavcodec/opusdec.c
index c5f06e0600..e9063014b3 100644
--- a/libavcodec/opusdec.c
+++ b/libavcodec/opusdec.c
@@ -584,6 +584,9 @@ static int opus_decode_packet(AVCodecContext *avctx, AVFrame *frame,
         s->decoded_samples = ret;
         decoded_samples       = FFMIN(decoded_samples, ret);
 
+        if (!buf)
+            continue;
+
         buf      += s->packet.packet_size;
         buf_size -= s->packet.packet_size;
     }



More information about the ffmpeg-cvslog mailing list