static int get_opcodes(GetByteContext *gb, uint32_t *table, uint8_t *dst, int op_size, int nb_elements)
{
OpcodeTable optable[1024];
- int sum, x, val, lshift, rshift, ret, size_in_bits, i, idx;
+ int sum, x, val, lshift, rshift, ret, i, idx;
+ int64_t size_in_bits;
unsigned endoffset, newoffset, offset;
unsigned next;
uint8_t *src = (uint8_t *)gb->buffer;
ret = decompress_tex(avctx);
if (ret < 0)
return ret;
+ {
+ int w_block = avctx->coded_width / ctx->texture_block_w;
+ int h_block = avctx->coded_height / ctx->texture_block_h;
+ if (w_block * h_block * ctx->tex_step > ctx->tex_size * 8LL)
+ return AVERROR_INVALIDDATA;
+ }
tframe.f = data;
ret = ff_thread_get_buffer(avctx, &tframe, 0);