[FFmpeg-cvslog] avcodec/iff: check if there is enough bytes left

Paul B Mahol git at videolan.org
Mon May 16 15:40:05 CEST 2016


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Mon May 16 15:37:24 2016 +0200| [8767470fb572f394104d24acffb70eea9ce48ad3] | committer: Paul B Mahol

avcodec/iff: check if there is enough bytes left

Signed-off-by: Paul B Mahol <onemda at gmail.com>

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

 libavcodec/iff.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavcodec/iff.c b/libavcodec/iff.c
index eef7ce1..85fae15 100644
--- a/libavcodec/iff.c
+++ b/libavcodec/iff.c
@@ -850,6 +850,9 @@ static void decode_delta_j(uint8_t *dst,
             for (g = 0; g < groups; g++) {
                 offset = bytestream2_get_be16(&gb);
 
+                if (bytestream2_get_bytes_left(&gb) < 1)
+                    return;
+
                 if (kludge_j)
                     offset = ((offset / (320 / 8)) * pitch) + (offset % (320 / 8)) - kludge_j;
                 else
@@ -893,6 +896,9 @@ static void decode_delta_j(uint8_t *dst,
                     for (d = 0; d < bpp; d++) {
                         unsigned noffset = offset + (r * pitch) + d * planepitch;
 
+                        if (bytestream2_get_bytes_left(&gb) < 1)
+                            return;
+
                         for (b = 0; b < bytes; b++) {
                             uint8_t value = bytestream2_get_byte(&gb);
 



More information about the ffmpeg-cvslog mailing list