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

Michael Niedermayer michael at niedermayer.cc
Mon Nov 9 23:41:47 CET 2015


On Sat, Nov 07, 2015 at 10:23:17PM +0800, Ni Hui wrote:
> 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));

ff_lzw_decode_tail() could consume less than the whole if FF_LZW_GIF
is set
so this doesnt seem entirely correct unless iam missing something

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Those who are best at talking, realize last or never when they are wrong.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20151109/d37c7489/attachment.sig>


More information about the ffmpeg-devel mailing list