]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/imc.c
fix aliasing warnings. simpler too.
[ffmpeg] / libavcodec / imc.c
index 35702f9b72a16b39b98166f2e176065dd424f202..237ff6816c2469f877285a549d46f9287392845e 100644 (file)
@@ -638,6 +638,10 @@ static int imc_decode_frame(AVCodecContext * avctx,
     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]);