atrac3: return error if packet is too small
authorJustin Ruggles <justin.ruggles@gmail.com>
Fri, 14 Oct 2011 21:10:33 +0000 (17:10 -0400)
committerJustin Ruggles <justin.ruggles@gmail.com>
Sat, 29 Oct 2011 19:06:31 +0000 (15:06 -0400)
libavcodec/atrac3.c

index 6828ff0..37245ef 100644 (file)
@@ -834,8 +834,7 @@ static int atrac3_decode_frame(AVCodecContext *avctx,
     if (buf_size < avctx->block_align) {
         av_log(avctx, AV_LOG_ERROR,
                "Frame too small (%d bytes). Truncated file?\n", buf_size);
-        *data_size = 0;
-        return buf_size;
+        return AVERROR_INVALIDDATA;
     }
 
     out_size = 1024 * q->channels * av_get_bytes_per_sample(avctx->sample_fmt);