summaryrefslogtreecommitdiff
path: root/libavcodec/opusdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-03-07 15:11:39 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-03-07 21:39:20 +0100
commit1ae092587fc196da5098dea346d7ece81ec35153 (patch)
treeac627194074d78a973f51895b2fe7695150cd0ee /libavcodec/opusdec.c
parente3201c38d53d2b8b24d0bc95d726b2cb1752dc12 (diff)
avcodec/opusdec: Clear out pointers per packet
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>
Diffstat (limited to 'libavcodec/opusdec.c')
-rw-r--r--libavcodec/opusdec.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/opusdec.c b/libavcodec/opusdec.c
index f8ca133a94..14d436b428 100644
--- a/libavcodec/opusdec.c
+++ b/libavcodec/opusdec.c
@@ -450,6 +450,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;