[FFmpeg-cvslog] avcodec/g2meet: Check init_get_bits8() return value

Michael Niedermayer git at videolan.org
Thu May 7 23:03:46 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu May  7 22:50:39 2015 +0200| [b1b0baa3d6a30942b258dddfdd04b4b24c713879] | committer: Michael Niedermayer

avcodec/g2meet: Check init_get_bits8() return value

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

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

 libavcodec/g2meet.c |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/libavcodec/g2meet.c b/libavcodec/g2meet.c
index 5c0b37d..6482483 100644
--- a/libavcodec/g2meet.c
+++ b/libavcodec/g2meet.c
@@ -253,7 +253,8 @@ static int jpg_decode_data(JPGContext *c, int width, int height,
         return ret;
     jpg_unescape(src, src_size, c->buf, &unesc_size);
     memset(c->buf + unesc_size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
-    init_get_bits8(&gb, c->buf, unesc_size);
+    if((ret = init_get_bits8(&gb, c->buf, unesc_size)) < 0)
+        return ret;
 
     width = FFALIGN(width, 16);
     mb_w  =  width        >> 4;
@@ -317,7 +318,7 @@ static int jpg_decode_data(JPGContext *c, int width, int height,
     return 0;
 }
 
-static void kempf_restore_buf(const uint8_t *src, int len,
+static int kempf_restore_buf(const uint8_t *src, int len,
                               uint8_t *dst, int stride,
                               const uint8_t *jpeg_tile, int tile_stride,
                               int width, int height,
@@ -325,8 +326,10 @@ static void kempf_restore_buf(const uint8_t *src, int len,
 {
     GetBitContext gb;
     int i, j, nb, col;
+    int ret;
 
-    init_get_bits8(&gb, src, len);
+    if ((ret = init_get_bits8(&gb, src, len)) < 0)
+        return ret;
 
     if (npal <= 2)       nb = 1;
     else if (npal <= 4)  nb = 2;
@@ -344,6 +347,8 @@ static void kempf_restore_buf(const uint8_t *src, int len,
                 memcpy(dst + i * 3, jpeg_tile + i * 3, 3);
         }
     }
+
+    return 0;
 }
 
 static int kempf_decode_tile(G2MContext *c, int tile_x, int tile_y,



More information about the ffmpeg-cvslog mailing list