avcodec/atrac3plusdec: consume only as many bytes as available
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 4 Jun 2015 20:47:24 +0000 (22:47 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 20 Jul 2015 02:43:39 +0000 (04:43 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6b6ae7c3ead5dee786a4aea929820076a7c82da4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/atrac3plusdec.c

index e6f0416..e98036e 100644 (file)
@@ -381,7 +381,7 @@ static int atrac3p_decode_frame(AVCodecContext *avctx, void *data,
 
     *got_frame_ptr = 1;
 
-    return avctx->block_align;
+    return FFMIN(avctx->block_align, avpkt->size);
 }
 
 AVCodec ff_atrac3p_decoder = {