changeset 6332:f2c6708aebf9 libavcodec

Check that we have enough input data in IMC decoder.
author reimar
date Tue, 05 Feb 2008 18:39:55 +0000
parents c57670e07668
children beb52d4a5efe
files imc.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/imc.c	Tue Feb 05 11:22:55 2008 +0000
+++ b/imc.c	Tue Feb 05 18:39:55 2008 +0000
@@ -638,6 +638,10 @@
     int counter, bitscount;
     uint16_t buf16[IMC_BLOCK_SIZE / 2];
 
+    if (buf_size < IMC_BLOCK_SIZE) {
+        av_log(avctx, AV_LOG_ERROR, "imc frame too small!\n");
+        return -1;
+    }
     for(i = 0; i < IMC_BLOCK_SIZE / 2; i++)
         buf16[i] = bswap_16(((const uint16_t*)buf)[i]);