diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-03-28 14:52:27 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-03-28 14:52:27 +0200 |
commit | a74d7218767bbf978f66c9b4c2bb77f7d77e9bde (patch) | |
tree | 9a6d1e152120ab17e61f7a93fa992c5ad35676d2 /libavcodec | |
parent | 92f7f1db421ee8b3431534fa09e8050ba622c33a (diff) | |
download | ffmpeg-a74d7218767bbf978f66c9b4c2bb77f7d77e9bde.tar.gz |
indeo4: apply correction to eob/esc indexes too
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/indeo4.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/indeo4.c b/libavcodec/indeo4.c index 488f97120a..15ed5f7c78 100644 --- a/libavcodec/indeo4.c +++ b/libavcodec/indeo4.c @@ -631,6 +631,10 @@ static int decode_band(IVI4DecContext *ctx, int plane_num, idx2 = band->corr[i * 2 + 1]; FFSWAP(uint8_t, band->rv_map->runtab[idx1], band->rv_map->runtab[idx2]); FFSWAP(int16_t, band->rv_map->valtab[idx1], band->rv_map->valtab[idx2]); + if (idx1 == band->rv_map->eob_sym || idx2 == band->rv_map->eob_sym) + band->rv_map->eob_sym ^= idx1 ^ idx2; + if (idx1 == band->rv_map->esc_sym || idx2 == band->rv_map->esc_sym) + band->rv_map->esc_sym ^= idx1 ^ idx2; } pos = get_bits_count(&ctx->gb); @@ -670,6 +674,10 @@ static int decode_band(IVI4DecContext *ctx, int plane_num, idx2 = band->corr[i * 2 + 1]; FFSWAP(uint8_t, band->rv_map->runtab[idx1], band->rv_map->runtab[idx2]); FFSWAP(int16_t, band->rv_map->valtab[idx1], band->rv_map->valtab[idx2]); + if (idx1 == band->rv_map->eob_sym || idx2 == band->rv_map->eob_sym) + band->rv_map->eob_sym ^= idx1 ^ idx2; + if (idx1 == band->rv_map->esc_sym || idx2 == band->rv_map->esc_sym) + band->rv_map->esc_sym ^= idx1 ^ idx2; } #if defined(DEBUG) && IVI4_DEBUG_CHECKSUM |