[MPlayer-cvslog] r21902 - trunk/libmpdemux/demux_gif.c
reimar
subversion at mplayerhq.hu
Sat Jan 13 12:40:05 CET 2007
Author: reimar
Date: Sat Jan 13 12:40:05 2007
New Revision: 21902
Modified:
trunk/libmpdemux/demux_gif.c
Log:
One more bounds check, though IMO the gif lib really should do this.
Modified: trunk/libmpdemux/demux_gif.c
==============================================================================
--- trunk/libmpdemux/demux_gif.c (original)
+++ trunk/libmpdemux/demux_gif.c Sat Jan 13 12:40:05 2007
@@ -121,10 +121,10 @@
{
int y;
int cnt = FFMIN(effective_map->ColorCount, 256);
- int l = FFMIN(gif->Image.Left, priv->w);
- int t = FFMIN(gif->Image.Top, priv->h);
- int w = FFMIN(gif->Image.Width, priv->w - l);
- int h = FFMIN(gif->Image.Height, priv->h - t);
+ int l = FFMAX(FFMIN(gif->Image.Left, priv->w), 0);
+ int t = FFMAX(FFMIN(gif->Image.Top, priv->h), 0);
+ int w = FFMAX(FFMIN(gif->Image.Width, priv->w - l), 0);
+ int h = FFMAX(FFMIN(gif->Image.Height, priv->h - t), 0);
// copy the palette
for (y = 0; y < cnt; y++) {
More information about the MPlayer-cvslog
mailing list