Commit 68eb2080 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/dxv: Check idx in dxv_decompress_dxt5()

Fixes potential out of array read

No testcase available
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent eb8a67de
......@@ -260,6 +260,10 @@ static int dxv_decompress_dxt5(AVCodecContext *avctx)
case 2:
/* Copy two dwords from a previous index */
idx = 8 + bytestream2_get_le16(gbc);
if (idx > pos) {
av_log(avctx, AV_LOG_ERROR, "idx %d > %d\n", idx, pos);
return AVERROR_INVALIDDATA;
}
prev = AV_RL32(ctx->tex_data + 4 * (pos - idx));
AV_WL32(ctx->tex_data + 4 * pos, prev);
pos++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment