diff options
author | Vitor Sessak <vitor1001@gmail.com> | 2010-08-09 07:17:01 +0000 |
---|---|---|
committer | Vitor Sessak <vitor1001@gmail.com> | 2010-08-09 07:17:01 +0000 |
commit | 46a76dec932d496a1482b359106cf313e20ea946 (patch) | |
tree | b8ef48146ecbf0101257a3672ad9a93c56616dea | |
parent | a4fc3bd5333d3b5d7dc7aba15ddfcc4fbebd95ac (diff) | |
download | ffmpeg-46a76dec932d496a1482b359106cf313e20ea946.tar.gz |
Fix handling of truncated files. Should fix random FATE breakages.
Originally committed as revision 24745 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/atrac3.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/atrac3.c b/libavcodec/atrac3.c index 3ac747ccfd..8ccba0bc70 100644 --- a/libavcodec/atrac3.c +++ b/libavcodec/atrac3.c @@ -827,8 +827,12 @@ static int atrac3_decode_frame(AVCodecContext *avctx, 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) { |