diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2013-06-30 09:57:56 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-07-10 18:51:42 +0200 |
commit | fffc9316daab9690ab0e124a0cfbcbb0faea836c (patch) | |
tree | 9178812c9f0830af29f55aa652c3f770f5b2c461 | |
parent | 9a87ba0933c83a1a8f79721f644ee9bf39add248 (diff) | |
download | ffmpeg-fffc9316daab9690ab0e124a0cfbcbb0faea836c.tar.gz |
indeo: Properly forward the error codes
If the tile data size does not match the buffer size it did not
return an AVERROR_INVALIDDATA causing futher corruption later.
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
(cherry picked from commit 7388c0c58601477db076e2e74e8b11f8a644384a)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/ivi_common.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libavcodec/ivi_common.c b/libavcodec/ivi_common.c index 21954ec5a4..180c19eb6f 100644 --- a/libavcodec/ivi_common.c +++ b/libavcodec/ivi_common.c @@ -804,8 +804,16 @@ static int decode_band(IVI45DecContext *ctx, break; result = ivi_decode_blocks(&ctx->gb, band, tile, avctx); - if (result < 0 || ((get_bits_count(&ctx->gb) - pos) >> 3) != tile->data_size) { - av_log(avctx, AV_LOG_ERROR, "Corrupted tile data encountered!\n"); + if (result < 0) { + av_log(avctx, AV_LOG_ERROR, + "Corrupted tile data encountered!\n"); + break; + } + + if (((get_bits_count(&ctx->gb) - pos) >> 3) != tile->data_size) { + av_log(avctx, AV_LOG_ERROR, + "Tile data_size mismatch!\n"); + result = AVERROR_INVALIDDATA; break; } |