Revision ebcf7c32 libavcodec/iff.c

View differences:

libavcodec/iff.c
123 123
    }
124 124

  
125 125
    count = 1 << avctx->bits_per_coded_sample;
126
    if (avctx->extradata_size < count * 3) {
127
        av_log(avctx, AV_LOG_ERROR, "palette data underflow\n");
128
        return AVERROR_INVALIDDATA;
129
    }
126
    // If extradata is smaller than actually needed, fill the remaining with black.
127
    count = FFMIN(avctx->extradata_size / 3, count);
130 128
    for (i=0; i < count; i++) {
131 129
        pal[i] = 0xFF000000 | AV_RB24( avctx->extradata + i*3 );
132 130
    }

Also available in: Unified diff