]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/escape124.c
avcodec/iff: add support for vertical word compression in ILBM
[ffmpeg] / libavcodec / escape124.c
index b872b3a53d7f4387fb34d5cb40b51346cbbd2dde..c3174ce6ef94c91bad5f5f74c9dd05bdf0e0431e 100644 (file)
@@ -249,6 +249,10 @@ static int escape124_decode_frame(AVCodecContext *avctx,
                 // This codebook can be cut off at places other than
                 // powers of 2, leaving some of the entries undefined.
                 cb_size = get_bits_long(&gb, 20);
+                if (!cb_size) {
+                    av_log(avctx, AV_LOG_ERROR, "Invalid codebook size 0.\n");
+                    return AVERROR_INVALIDDATA;
+                }
                 cb_depth = av_log2(cb_size - 1) + 1;
             } else {
                 cb_depth = get_bits(&gb, 4);