[FFmpeg-cvslog] avcodec/wmaprodec: reset offsets when error happens

Paul B Mahol git at videolan.org
Mon Mar 20 16:37:23 EET 2017


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Mon Mar 20 15:05:01 2017 +0100| [ce818d90bdb28d8591e6b81e020d1e7f87536649] | committer: Paul B Mahol

avcodec/wmaprodec: reset offsets when error happens

Fixes #6250.

Signed-off-by: Paul B Mahol <onemda at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ce818d90bdb28d8591e6b81e020d1e7f87536649
---

 libavcodec/wmaprodec.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c
index 1ad1e23..5b1fe40 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 ||



More information about the ffmpeg-cvslog mailing list