summaryrefslogtreecommitdiff
path: root/libavcodec/wmaprodec.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2017-03-20 15:05:01 +0100
committerPaul B Mahol <onemda@gmail.com>2017-03-20 15:36:55 +0100
commitce818d90bdb28d8591e6b81e020d1e7f87536649 (patch)
treecb8d0eef442ea1e2dde4cb19d465b08cb14a240b /libavcodec/wmaprodec.c
parent20c4fb2e010fff7e3f8acd36ad132c0140fec5fb (diff)
downloadffmpeg-ce818d90bdb28d8591e6b81e020d1e7f87536649.tar.gz
avcodec/wmaprodec: reset offsets when error happens
Fixes #6250. Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/wmaprodec.c')
-rw-r--r--libavcodec/wmaprodec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c
index 1ad1e23541..5b1fe40a42 100644
--- a/libavcodec/wmaprodec.c
+++ b/libavcodec/wmaprodec.c
@@ -1760,6 +1760,10 @@ static int xma_decode_packet(AVCodecContext *avctx, void *data,
memcpy(&s->samples[s->current_stream * 2 + 1][s->offset[s->current_stream] * 512],
s->frames[s->current_stream]->extended_data[1], 512 * 4);
s->offset[s->current_stream]++;
+ } else if (ret < 0) {
+ memset(s->offset, 0, sizeof(s->offset));
+ s->current_stream = 0;
+ return ret;
}
if (s->xma[s->current_stream].packet_done ||