avcodec/opus: don't materialize buf pointer from null
authorKacper Michajłow <kasper93@gmail.com>
Thu, 3 Jul 2025 21:08:23 +0000 (23:08 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 4 Aug 2025 14:36:10 +0000 (16:36 +0200)
Fixes: avcodec/opus/dec.c: runtime error: applying non-zero offset 10 to null pointer

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

index 8ca99369c6f68107bb8dc8de22f8f7d8233792e5..d64d77617c4e800dbc6f18f54d57e3922bc33493 100644 (file)
@@ -522,6 +522,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;
     }