[FFmpeg-cvslog] avcodec/indeo3: ensure offsets are non negative

Michael Niedermayer git at videolan.org
Sun Dec 21 04:50:35 CET 2014


ffmpeg | branch: release/1.1 | Michael Niedermayer <michaelni at gmx.at> | Thu Dec 18 18:57:27 2014 +0100| [45509d0730e34423ccc637475a6db694fdf95341] | committer: Michael Niedermayer

avcodec/indeo3: ensure offsets are non negative

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 368642361f3a589d7b0c23ea327d988edb434e3f)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/indeo3.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/indeo3.c b/libavcodec/indeo3.c
index 85af622..1f6d342 100644
--- a/libavcodec/indeo3.c
+++ b/libavcodec/indeo3.c
@@ -988,7 +988,8 @@ static int decode_frame_headers(Indeo3DecodeContext *ctx, AVCodecContext *avctx,
     ctx->y_data_size = ends[0] - starts[0];
     ctx->v_data_size = ends[1] - starts[1];
     ctx->u_data_size = ends[2] - starts[2];
-    if (FFMAX3(y_offset, v_offset, u_offset) >= ctx->data_size - 16 ||
+    if (FFMIN3(y_offset, v_offset, u_offset) < 0 ||
+        FFMAX3(y_offset, v_offset, u_offset) >= ctx->data_size - 16 ||
         FFMIN3(y_offset, v_offset, u_offset) < gb.buffer - bs_hdr + 16 ||
         FFMIN3(ctx->y_data_size, ctx->v_data_size, ctx->u_data_size) <= 0) {
         av_log(avctx, AV_LOG_ERROR, "One of the y/u/v offsets is invalid\n");



More information about the ffmpeg-cvslog mailing list