Browse code

avcodec/wmaprodec: reset offsets when error happens

Fixes #6250.

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

Paul B Mahol authored on 2017/03/20 23:05:01
Showing 1 changed files
... ...
@@ -1760,6 +1760,10 @@ static int xma_decode_packet(AVCodecContext *avctx, void *data,
1760 1760
             memcpy(&s->samples[s->current_stream * 2 + 1][s->offset[s->current_stream] * 512],
1761 1761
                    s->frames[s->current_stream]->extended_data[1], 512 * 4);
1762 1762
         s->offset[s->current_stream]++;
1763
+    } else if (ret < 0) {
1764
+        memset(s->offset, 0, sizeof(s->offset));
1765
+        s->current_stream = 0;
1766
+        return ret;
1763 1767
     }
1764 1768
 
1765 1769
     if (s->xma[s->current_stream].packet_done ||