Browse Source

indeo: Check allocated tile size in ff_ivi_process_empty_tile()

This prevents writing into a too small array if some parameters changed
without the tile being reallocated.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n0.11
Michael Niedermayer 13 years ago
parent
commit
f0bf9e9c2a
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      libavcodec/ivi_common.c

+ 6
- 0
libavcodec/ivi_common.c View File

@@ -486,6 +486,12 @@ void ff_ivi_process_empty_tile(AVCodecContext *avctx, IVIBandDesc *band,
void (*mc_no_delta_func)(int16_t *buf, const int16_t *ref_buf, uint32_t pitch, void (*mc_no_delta_func)(int16_t *buf, const int16_t *ref_buf, uint32_t pitch,
int mc_type); int mc_type);


if( tile->num_MBs != IVI_MBs_PER_TILE(tile->width, tile->height, band->mb_size) ){
av_log(avctx, AV_LOG_ERROR, "allocated tile size %d mismatches parameters %d in ff_ivi_process_empty_tile()\n",
tile->num_MBs, IVI_MBs_PER_TILE(tile->width, tile->height, band->mb_size));
return;
}

offs = tile->ypos * band->pitch + tile->xpos; offs = tile->ypos * band->pitch + tile->xpos;
mb = tile->mbs; mb = tile->mbs;
ref_mb = tile->ref_mbs; ref_mb = tile->ref_mbs;


Loading…
Cancel
Save