[FFmpeg-cvslog] avcodec/g2meet: fix src pointer checks in kempf_decode_tile()

Michael Niedermayer git at videolan.org
Sun Aug 11 00:28:23 CEST 2013


ffmpeg | branch: release/2.0 | Michael Niedermayer <michaelni at gmx.at> | Wed Aug  7 15:50:26 2013 +0200| [acf511de34e0b79fff0183e06ed37f1aa8dc3d94] | committer: Michael Niedermayer

avcodec/g2meet: fix src pointer checks in kempf_decode_tile()

Fixes Ticket2842

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

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

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

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

diff --git a/libavcodec/g2meet.c b/libavcodec/g2meet.c
index bc01dfa..d31fc54 100644
--- a/libavcodec/g2meet.c
+++ b/libavcodec/g2meet.c
@@ -389,7 +389,7 @@ static int kempf_decode_tile(G2MContext *c, int tile_x, int tile_y,
         return 0;
     zsize = (src[0] << 8) | src[1]; src += 2;
 
-    if (src_end - src < zsize)
+    if (src_end - src < zsize + (sub_type != 2))
         return AVERROR_INVALIDDATA;
 
     ret = uncompress(c->kempf_buf, &dlen, src, zsize);
@@ -411,6 +411,8 @@ static int kempf_decode_tile(G2MContext *c, int tile_x, int tile_y,
     for (i = 0; i < (FFALIGN(height, 16) >> 4); i++) {
         for (j = 0; j < (FFALIGN(width, 16) >> 4); j++) {
             if (!bits) {
+                if (src >= src_end)
+                    return AVERROR_INVALIDDATA;
                 bitbuf = *src++;
                 bits   = 8;
             }



More information about the ffmpeg-cvslog mailing list