[FFmpeg-devel] [PATCH] avcodec/gifdec: skip data lzw consumed

Ni Hui shuizhuyuanluo at 126.com
Sat Nov 7 15:23:17 CET 2015


fix the return code value of avcodec_decode_video2 for gif decoding, which should be the consumed data length.

---
 libavcodec/gifdec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/gifdec.c b/libavcodec/gifdec.c
index 9f2e6eb..5bcb176 100644
--- a/libavcodec/gifdec.c
+++ b/libavcodec/gifdec.c
@@ -295,6 +295,8 @@ static int gif_read_image(GifState *s, AVFrame *frame)
     /* read the garbage data until end marker is found */
     ff_lzw_decode_tail(s->lzw);
 
+    bytestream2_skipu(&s->gb, bytestream2_get_bytes_left(&s->gb));
+
     /* Graphic Control Extension's scope is single frame.
      * Remove its influence. */
     s->transparent_color_index = -1;
-- 
2.4.1




More information about the ffmpeg-devel mailing list