|
|
@ -496,12 +496,6 @@ static int ivi_dec_tile_data_size(GetBitContext *gb) |
|
|
|
static int ivi_dc_transform(const IVIBandDesc *band, int *prev_dc, int buf_offs, |
|
|
|
static int ivi_dc_transform(const IVIBandDesc *band, int *prev_dc, int buf_offs, |
|
|
|
int blk_size) |
|
|
|
int blk_size) |
|
|
|
{ |
|
|
|
{ |
|
|
|
int buf_size = band->pitch * band->aheight - buf_offs; |
|
|
|
|
|
|
|
int min_size = (blk_size - 1) * band->pitch + blk_size; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (min_size > buf_size) |
|
|
|
|
|
|
|
return AVERROR_INVALIDDATA; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
band->dc_transform(prev_dc, band->buf + buf_offs, |
|
|
|
band->dc_transform(prev_dc, band->buf + buf_offs, |
|
|
|
band->pitch, blk_size); |
|
|
|
band->pitch, blk_size); |
|
|
|
|
|
|
|
|
|
|
@ -732,6 +726,11 @@ static int ivi_decode_blocks(GetBitContext *gb, const IVIBandDesc *band, |
|
|
|
if (ret < 0) |
|
|
|
if (ret < 0) |
|
|
|
return ret; |
|
|
|
return ret; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
int buf_size = band->pitch * band->aheight - buf_offs; |
|
|
|
|
|
|
|
int min_size = (blk_size - 1) * band->pitch + blk_size; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (min_size > buf_size) |
|
|
|
|
|
|
|
return AVERROR_INVALIDDATA; |
|
|
|
/* block not coded */ |
|
|
|
/* block not coded */ |
|
|
|
/* for intra blocks apply the dc slant transform */ |
|
|
|
/* for intra blocks apply the dc slant transform */ |
|
|
|
/* for inter - perform the motion compensation without delta */ |
|
|
|
/* for inter - perform the motion compensation without delta */ |
|
|
|