Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2013-06-30 11:57:56 +0400
committerLuca Barbato <lu_zero@gentoo.org>2013-07-01 06:17:46 +0400
commit7388c0c58601477db076e2e74e8b11f8a644384a (patch)
tree076038fc6d3b20481060a98a539f4fe1fddffd7a /libavcodec/ivi_common.c
parent1221bb623978c013046bcb8e5af7f6b9b418a10e (diff)
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 CC: libav-stable@libav.org
Diffstat (limited to 'libavcodec/ivi_common.c')
-rw-r--r--libavcodec/ivi_common.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/libavcodec/ivi_common.c b/libavcodec/ivi_common.c
index f7e241bf91..cdd4376063 100644
--- a/libavcodec/ivi_common.c
+++ b/libavcodec/ivi_common.c
@@ -778,8 +778,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;
}