avcodec/mlpdec: Fail if the input is too small
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 27 Sep 2013 18:12:37 +0000 (20:12 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 27 Sep 2013 18:12:37 +0000 (20:12 +0200)
This fixes a infinite loop
Fixes Ticket2986

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

index 059e4d0..961ed62 100644 (file)
@@ -1070,7 +1070,7 @@ static int read_access_unit(AVCodecContext *avctx, void* data,
     int ret;
 
     if (buf_size < 4)
-        return 0;
+        return AVERROR_INVALIDDATA;
 
     length = (AV_RB16(buf) & 0xfff) * 2;