twinvq: return an error when the packet size is too small
authorJustin Ruggles <justin.ruggles@gmail.com>
Fri, 23 Sep 2011 23:25:47 +0000 (19:25 -0400)
committerJustin Ruggles <justin.ruggles@gmail.com>
Sat, 22 Oct 2011 19:38:05 +0000 (15:38 -0400)
libavcodec/twinvq.c

index 1326d22..1c800ee 100644 (file)
@@ -831,8 +831,7 @@ static int twin_decode_frame(AVCodecContext * avctx, void *data,
     if (buf_size*8 < avctx->bit_rate*mtab->size/avctx->sample_rate + 8) {
         av_log(avctx, AV_LOG_ERROR,
                "Frame too small (%d bytes). Truncated file?\n", buf_size);
-        *data_size = 0;
-        return buf_size;
+        return AVERROR(EINVAL);
     }
 
     init_get_bits(&gb, buf, buf_size * 8);