[FFmpeg-devel] [PATCH] gifdec: use truncated width for image manipulation

Michael Niedermayer michaelni at gmx.at
Mon Aug 18 10:04:46 CEST 2014


On Mon, Aug 18, 2014 at 09:42:08AM +0200, Christophe Gisquet wrote:
> Hi,
> 
> 2014-08-17 23:53 GMT+02:00 Michael Niedermayer <michaelni at gmx.at>:
> >> > i think these need a check for top >= s->screen_height and
> >> > left >= s->screen_width
> [...]
> > 0x00000000007319ea in gif_fill_rect (picture=0x1a96a60, color=16777215, l=0, t=65535, w=192, h=-65367) at libavcodec/gifdec.c:108
> 
> Sorry for missing the obvious, indeed in those cases pw/height would
> end negative...
> 
> So I have added the checks you propose and decided to shuffle them
> with the others.
> 
> Updated patch attached.
> 
> -- 
> Christophe

>  gifdec.c |   31 ++++++++++++++++++++++---------
>  1 file changed, 22 insertions(+), 9 deletions(-)
> 76cade6cedda47f5f98817afa6892a2f64a2692a  0001-gifdec-use-truncated-width-for-image-manipulation.patch
> From a8a329b19d72405b6cc7de173e3f160be02e212d Mon Sep 17 00:00:00 2001
> From: Christophe Gisquet <christophe.gisquet at gmail.com>
> Date: Sun, 17 Aug 2014 09:47:46 +0200
> Subject: [PATCH] gifdec: use truncated width for image manipulation
> 
> Some files seem to have an off-by-one error. In most cases, it appears to
> be on the image width. Therefore, if the decoded image doesn't fit in the
> screen:
> - If it is wider than the screen (and the lzw decoding buffer), reject it;
> - Otherwise, decode the indicated amount, but only write a truncated amount
>   to the screen.
> 
> Fixes ticket #3538.

patch applied

thanks

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Rewriting code that is poorly written but fully understood is good.
Rewriting code that one doesnt understand is a sign that one is less smart
then the original author, trying to rewrite it will not make it better.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140818/6d67852a/attachment.asc>


More information about the ffmpeg-devel mailing list