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 <michaelni@gmx.at>
Thu, 4 Jun 2015 21:10:56 +0000 (23:10 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/atrac3plusdec.c

index f858497..b4437f1 100644 (file)
@@ -384,7 +384,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 = {