avcodec/opusdec: Clear out pointers per packet
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 7 Mar 2015 14:11:39 +0000 (15:11 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 21 Mar 2015 00:52:52 +0000 (01:52 +0100)
This is safer than to assume that all error pathes cleared them and
nothing will use uncleared pointers.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1ae092587fc196da5098dea346d7ece81ec35153)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/opusdec.c

index 759eaa5..0825fc0 100644 (file)
@@ -452,6 +452,12 @@ static int opus_decode_packet(AVCodecContext *avctx, void *data,
     int decoded_samples = 0;
     int i, ret;
 
+    for (i = 0; i < c->nb_streams; i++) {
+        OpusStreamContext *s = &c->streams[i];
+        s->out[0] =
+        s->out[1] = NULL;
+    }
+
     /* decode the header of the first sub-packet to find out the sample count */
     if (buf) {
         OpusPacket *pkt = &c->streams[0].packet;