mpc7: return error if packet is too small.
authorJustin Ruggles <justin.ruggles@gmail.com>
Wed, 14 Sep 2011 15:16:42 +0000 (11:16 -0400)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 6 Nov 2011 18:49:12 +0000 (19:49 +0100)
(cherry picked from commit 8290d1f38b438f1b070de67645c8b4a42014c7ac)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 490617b6ffa13f8e49a196a752f927d5ebad6e2b)

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

index 2858255..34f7693 100644 (file)
@@ -170,6 +170,7 @@ static int mpc7_decode_frame(AVCodecContext * avctx,
     memset(bands, 0, sizeof(bands));
     if(buf_size <= 4){
         av_log(avctx, AV_LOG_ERROR, "Too small buffer passed (%i bytes)\n", buf_size);
+        return AVERROR(EINVAL);
     }
 
     out_size = (buf[1] ? c->lastframelen : MPC_FRAME_SIZE) * 4;