---
 libavcodec/adpcm.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index 4edbfa0..e29dc76 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -836,13 +836,12 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void 
*data,
         }
         break;
     case CODEC_ID_ADPCM_XA:
-        while (buf_size >= 128) {
-            if ((ret = xa_decode(avctx, samples, src, &c->status[0],
+        while (bytestream2_get_bytes_left(&gb) >= 128) {
+            if ((ret = xa_decode(avctx, samples, buf + bytestream2_tell(&gb), 
&c->status[0],
                                  &c->status[1], avctx->channels)) < 0)
                 return ret;
-            src += 128;
+            bytestream2_skipu(&gb, 128);
             samples += 28 * 8;
-            buf_size -= 128;
         }
         break;
     case CODEC_ID_ADPCM_IMA_EA_EACS:
-- 
1.7.2.1

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to