X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fdiracdec.c;h=22ec913bf7df0c0aade85dc6acda9f2a59b86462;hb=77937a42e7127271bd50d7f8035c3ebd5a1047c5;hp=a1e759f6563c8c0a4fc2d294245b842eeeca0fae;hpb=dd2a2a51fe47361fa82c67f2a417e1706713eaef;p=ffmpeg diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c index a1e759f6563..22ec913bf7d 100644 --- a/libavcodec/diracdec.c +++ b/libavcodec/diracdec.c @@ -1276,7 +1276,9 @@ static int dirac_unpack_idwt_params(DiracContext *s) s->num_y = get_interleaved_ue_golomb(gb); if (s->num_x * s->num_y == 0 || s->num_x * (uint64_t)s->num_y > INT_MAX || s->num_x * (uint64_t)s->avctx->width > INT_MAX || - s->num_y * (uint64_t)s->avctx->height > INT_MAX + s->num_y * (uint64_t)s->avctx->height > INT_MAX || + s->num_x > s->avctx->width || + s->num_y > s->avctx->height ) { av_log(s->avctx,AV_LOG_ERROR,"Invalid numx/y\n"); s->num_x = s->num_y = 0; @@ -1432,9 +1434,9 @@ static void global_mv(DiracContext *s, DiracBlock *block, int x, int y, int ref) int *b = s->globalmc[ref].pan_tilt; int *c = s->globalmc[ref].perspective; - int m = (1<u.mv[ref][0] = (mx + (1<<(ez+ep))) >> (ez+ep); block->u.mv[ref][1] = (my + (1<<(ez+ep))) >> (ez+ep); @@ -1551,6 +1553,11 @@ static int dirac_unpack_block_motion_data(DiracContext *s) } } + for (i = 0; i < 4 + 2*s->num_refs; i++) { + if (arith[i].error) + return arith[i].error; + } + return 0; }