changeset 12380:e402b74c4b62 libavcodec

Fix handling of truncated files. Should fix random FATE breakages.
author vitor
date Mon, 09 Aug 2010 07:17:01 +0000
parents 2ea2fd28da07
children 2ba9068e748d
files atrac3.c
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/atrac3.c	Sat Aug 07 23:10:25 2010 +0000
+++ b/atrac3.c	Mon Aug 09 07:17:01 2010 +0000
@@ -827,8 +827,12 @@
     const uint8_t* databuf;
     int16_t* samples = data;
 
-    if (buf_size < avctx->block_align)
+    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;
+    }
 
     /* Check if we need to descramble and what buffer to pass on. */
     if (q->scrambled_stream) {