summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorVitor Sessak <vitor1001@gmail.com>2008-05-24 16:20:37 +0000
committerVitor Sessak <vitor1001@gmail.com>2008-05-24 16:20:37 +0000
commit84490b744e2f5dc485474562169d12b79eee9634 (patch)
treef18f7511a091dbf4d3fa6c3d7f4bf2acf4594f97 /libavcodec
parent9d2e6e84ceb10932713f8c1bdc11a0fa01de0fc1 (diff)
Handle the case where we do not have enough input
Originally committed as revision 13282 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/ra144.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libavcodec/ra144.c b/libavcodec/ra144.c
index 5fd2a245dc..5cfe94f25e 100644
--- a/libavcodec/ra144.c
+++ b/libavcodec/ra144.c
@@ -343,9 +343,11 @@ static int ra144_decode_frame(AVCodecContext * avctx,
Real144_internal *glob = avctx->priv_data;
GetBitContext gb;
- if(buf_size == 0)
- return 0;
-
+ if(buf_size < 20) {
+ av_log(avctx, AV_LOG_ERROR,
+ "Frame too small (%d bytes). Truncated file?\n", buf_size);
+ return buf_size;
+ }
init_get_bits(&gb, buf, 20 * 8);
for (i=0; i<10; i++)