avcodec/dxv: Check idx in CHECKPOINT()
Fixes out of array read Fixes Ticket5098 Fixes Ticket5099 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
43624a669b
commit
eb8a67de75
@ -105,9 +105,17 @@ static int decompress_texture_thread(AVCodecContext *avctx, void *arg,
|
|||||||
break; \
|
break; \
|
||||||
case 2: \
|
case 2: \
|
||||||
idx = (bytestream2_get_byte(gbc) + 2) * x; \
|
idx = (bytestream2_get_byte(gbc) + 2) * x; \
|
||||||
|
if (idx > pos) { \
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "idx %d > %d\n", idx, pos); \
|
||||||
|
return AVERROR_INVALIDDATA; \
|
||||||
|
} \
|
||||||
break; \
|
break; \
|
||||||
case 3: \
|
case 3: \
|
||||||
idx = (bytestream2_get_le16(gbc) + 0x102) * x; \
|
idx = (bytestream2_get_le16(gbc) + 0x102) * x; \
|
||||||
|
if (idx > pos) { \
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "idx %d > %d\n", idx, pos); \
|
||||||
|
return AVERROR_INVALIDDATA; \
|
||||||
|
} \
|
||||||
break; \
|
break; \
|
||||||
} \
|
} \
|
||||||
} while(0)
|
} while(0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user