diff --git a/libavcodec/dxv.c b/libavcodec/dxv.c index ae79de981f..8d5e4b1c6c 100644 --- a/libavcodec/dxv.c +++ b/libavcodec/dxv.c @@ -745,7 +745,7 @@ static int dxv_decompress_cocg(DXVContext *ctx, GetByteContext *gb, int skip0, skip1, oi0 = 0, oi1 = 0; int ret, state0 = 0, state1 = 0; - if (op_offset < 12) + if (op_offset < 12 || op_offset - 12 > bytestream2_get_bytes_left(gb)) return AVERROR_INVALIDDATA; dst = tex_data;