aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2012-05-19 13:08:51 +0200
committerReinhard Tartler <siretart@tauware.de>2012-10-14 16:03:23 -0400
commite0daa15a96cff78f633dfcb5a7f0eeb2204ca82c (patch)
tree668870dce52907f224af0448be07476f931cb5b0
parent911c250aef9ff5561bf457c74367542730b0c84b (diff)
downloadffmpeg-e0daa15a96cff78f633dfcb5a7f0eeb2204ca82c.tar.gz
indeo: track tile macroblock size
(cherry picked from commit a6e4ac40a62930d3c90f869990f96fedb9a5d654) Signed-off-by: Reinhard Tartler <siretart@tauware.de>
-rw-r--r--libavcodec/ivi_common.c6
-rw-r--r--libavcodec/ivi_common.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/ivi_common.c b/libavcodec/ivi_common.c
index ebd9058a21..5626cd1855 100644
--- a/libavcodec/ivi_common.c
+++ b/libavcodec/ivi_common.c
@@ -287,6 +287,7 @@ int av_cold ff_ivi_init_tiles(IVIPlaneDesc *planes, int tile_width, int tile_hei
for (x = 0; x < band->width; x += t_width) {
tile->xpos = x;
tile->ypos = y;
+ tile->mb_size = band->mb_size;
tile->width = FFMIN(band->width - x, t_width);
tile->height = FFMIN(band->height - y, t_height);
tile->is_empty = tile->data_size = 0;
@@ -672,6 +673,11 @@ static int decode_band(IVI45DecContext *ctx, int plane_num,
for (t = 0; t < band->num_tiles; t++) {
tile = &band->tiles[t];
+ if (tile->mb_size != band->mb_size) {
+ av_log(avctx, AV_LOG_ERROR, "MB sizes mismatch: %d vs. %d\n",
+ band->mb_size, tile->mb_size);
+ return AVERROR_INVALIDDATA;
+ }
tile->is_empty = get_bits1(&ctx->gb);
if (tile->is_empty) {
ff_ivi_process_empty_tile(avctx, band, tile,
diff --git a/libavcodec/ivi_common.h b/libavcodec/ivi_common.h
index d3edea0c0e..6842d748b3 100644
--- a/libavcodec/ivi_common.h
+++ b/libavcodec/ivi_common.h
@@ -118,6 +118,7 @@ typedef struct {
int ypos;
int width;
int height;
+ int mb_size;
int is_empty; ///< = 1 if this tile doesn't contain any data
int data_size; ///< size of the data in bytes
int num_MBs; ///< number of macroblocks in this tile