changeset 6854:d4c8338a09a8 libavcodec

Handle the case where we do not have enough input
author vitor
date Sat, 24 May 2008 16:20:37 +0000
parents 9bfb69f1739e
children 128af7cac045
files ra144.c
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ra144.c	Sat May 24 12:58:20 2008 +0000
+++ b/ra144.c	Sat May 24 16:20:37 2008 +0000
@@ -343,9 +343,11 @@
     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++)