[FFmpeg-cvslog] indeo: Properly forward the error codes

Luca Barbato git at videolan.org
Mon Jul 29 04:40:46 CEST 2013


ffmpeg | branch: release/0.10 | Luca Barbato <lu_zero at gentoo.org> | Sun Jun 30 09:57:56 2013 +0200| [7658333c175562edb89136191fd577ad4a7f5795] | committer: Reinhard Tartler

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 at libav.org
(cherry picked from commit 7388c0c58601477db076e2e74e8b11f8a644384a)

Signed-off-by: Reinhard Tartler <siretart at tauware.de>

Conflicts:
	libavcodec/ivi_common.c

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7658333c175562edb89136191fd577ad4a7f5795
---

 libavcodec/ivi_common.c |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/libavcodec/ivi_common.c b/libavcodec/ivi_common.c
index 00205ae..ed9c283 100644
--- a/libavcodec/ivi_common.c
+++ b/libavcodec/ivi_common.c
@@ -737,8 +737,16 @@ static int decode_band(IVI45DecContext *ctx, int plane_num,
                 break;
 
             result = ff_ivi_decode_blocks(&ctx->gb, band, tile);
-            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;
             }
 



More information about the ffmpeg-cvslog mailing list