changeset 9663:041c635d0f69 libavcodec

Make TMV decoder check packet sizes before reading from it. FATE test 295 might need updating.
author vitor
date Sun, 17 May 2009 09:48:12 +0000
parents 34be4ff86302
children df1875099613
files tmv.c
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tmv.c	Sun May 17 09:09:07 2009 +0000
+++ b/tmv.c	Sun May 17 09:48:12 2009 +0000
@@ -52,6 +52,13 @@
         return -1;
     }
 
+    if (avpkt->size < 2*char_rows*char_cols) {
+        av_log(avctx, AV_LOG_ERROR,
+               "Input buffer too small, truncated sample?\n");
+        *data_size = 0;
+        return -1;
+    }
+
     tmv->pic.pict_type = FF_I_TYPE;
     tmv->pic.key_frame = 1;
     dst                = tmv->pic.data[0];