diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-03-07 15:11:39 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-03-29 03:34:22 +0200 |
commit | ee820d05127343a14f056b1ca0aec5f9f7db6a38 (patch) | |
tree | 1d621493465ee714dd87b30d092d773b73adda7c | |
parent | 9821cf9e6e6e509f4fba95eddd048b0f78ce372d (diff) | |
download | ffmpeg-ee820d05127343a14f056b1ca0aec5f9f7db6a38.tar.gz |
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>
(cherry picked from commit 1ae092587fc196da5098dea346d7ece81ec35153)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/opusdec.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/opusdec.c b/libavcodec/opusdec.c index 3ce519d1dc..bd27ec592f 100644 --- a/libavcodec/opusdec.c +++ b/libavcodec/opusdec.c @@ -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; |