AVFrame *pic;
GetBitContext gb;
+ int error;
BswapDSPContext bdsp;
uint8_t *buffer;
{
if (ctx->tok_ptrs[type] >= ctx->tok_lens[type]) {
av_log(ctx->avctx, AV_LOG_ERROR, "Read token from stream %i out of bounds (%i>=%i)\n", type, ctx->tok_ptrs[type], ctx->tok_lens[type]);
+ ctx->error = 1;
return 0;
}
if (type <= TM2_MOT) {
/* recalculate last and delta values for next blocks */
#define TM2_RECALC_BLOCK(CHR, stride, last, CD) {\
- CD[0] = CHR[1] - last[1];\
- CD[1] = (int)CHR[stride + 1] - (int)CHR[1];\
+ CD[0] = (unsigned)CHR[ 1] - (unsigned)last[1];\
+ CD[1] = (unsigned)CHR[stride + 1] - (unsigned) CHR[1];\
last[0] = (int)CHR[stride + 0];\
last[1] = (int)CHR[stride + 1];}
default:
av_log(ctx->avctx, AV_LOG_ERROR, "Skipping unknown block type %i\n", type);
}
+ if (ctx->error)
+ return AVERROR_INVALIDDATA;
}
}
int offset = TM2_HEADER_SIZE;
int i, t, ret;
+ l->error = 0;
+
av_fast_padded_malloc(&l->buffer, &l->buffer_size, buf_size);
if (!l->buffer) {
av_log(avctx, AV_LOG_ERROR, "Cannot allocate temporary buffer\n");