]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/4xm.c
avfilter/vf_lenscorrection: add >8 depth support
[ffmpeg] / libavcodec / 4xm.c
index 1f4e2aee24c2396336d6bff414208ea56d261d8c..4d58b093f76f0b3ce8b5e45759d377e6457628a8 100644 (file)
@@ -30,6 +30,7 @@
 #include "libavutil/frame.h"
 #include "libavutil/imgutils.h"
 #include "libavutil/intreadwrite.h"
+#include "libavutil/mem_internal.h"
 #include "avcodec.h"
 #include "blockdsp.h"
 #include "bswapdsp.h"
@@ -525,6 +526,10 @@ static int decode_i_block(FourXContext *f, int16_t *block)
             break;
         if (code == 0xf0) {
             i += 16;
+            if (i >= 64) {
+                av_log(f->avctx, AV_LOG_ERROR, "run %d overflow\n", i);
+                return 0;
+            }
         } else {
             if (code & 0xf) {
                 level = get_xbits(&f->gb, code & 0xf);