changeset 7506:e94202a2e0b6 libavcodec

Check available size before writing in decode_frame()
author vitor
date Wed, 06 Aug 2008 05:06:10 +0000
parents 2c22852d1998
children 8f89a4d76a71
files ra144.c
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ra144.c	Wed Aug 06 03:00:15 2008 +0000
+++ b/ra144.c	Wed Aug 06 05:06:10 2008 +0000
@@ -315,6 +315,9 @@
     RA144Context *ractx = avctx->priv_data;
     GetBitContext gb;
 
+    if (*data_size < 2*160)
+        return -1;
+
     if(buf_size < 20) {
         av_log(avctx, AV_LOG_ERROR,
                "Frame too small (%d bytes). Truncated file?\n", buf_size);