[FFmpeg-devel] [PATCH] lavf/gifdec: allow GCE of size 3.

Clément Bœsch ubitux at gmail.com
Thu Apr 18 04:18:28 CEST 2013


If there is no transparency flag, the transparent color index is not
part of the of the block, and the size becomes 3B.

Quoting the specifications:
    viii) Transparency Index - The Transparency Index is such that when
    encountered, the corresponding pixel of the display device is not
    modified and processing goes on to the next pixel. The index is
    present if and only if the Transparency Flag is set to 1.
---
 libavformat/gifdec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/gifdec.c b/libavformat/gifdec.c
index 1122849..3ec8160 100644
--- a/libavformat/gifdec.c
+++ b/libavformat/gifdec.c
@@ -139,8 +139,8 @@ static int gif_read_ext(AVFormatContext *s)
     int ret;
 
     if (ext_label == GIF_GCE_EXT_LABEL) {
-        if ((sb_size = avio_r8(pb)) < 4) {
-            av_log(s, AV_LOG_FATAL, "Graphic Control Extension block's size less than 4.\n");
+        if ((sb_size = avio_r8(pb)) < 3) {
+            av_log(s, AV_LOG_FATAL, "Graphic Control Extension block's size less than 3.\n");
             return AVERROR_INVALIDDATA;
         }
 
-- 
1.8.2.1



More information about the ffmpeg-devel mailing list