diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-01-13 11:40:05 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-01-13 11:40:05 +0000 |
commit | d359f1537cd8ef9b7b0d22b001a196a47c012bc7 (patch) | |
tree | e5e1ee4f15f425413f4fa85f2a5cc50918d0d0c4 /libmpdemux | |
parent | 0636ab5f58f91ea952d955389bcca64e0490eb85 (diff) | |
download | mpv-d359f1537cd8ef9b7b0d22b001a196a47c012bc7.tar.bz2 mpv-d359f1537cd8ef9b7b0d22b001a196a47c012bc7.tar.xz |
One more bounds check, though IMO the gif lib really should do this.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21902 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r-- | libmpdemux/demux_gif.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libmpdemux/demux_gif.c b/libmpdemux/demux_gif.c index e36514bb8b..af1087f5ab 100644 --- a/libmpdemux/demux_gif.c +++ b/libmpdemux/demux_gif.c @@ -121,10 +121,10 @@ static int demux_gif_fill_buffer(demuxer_t *demuxer, demux_stream_t *ds) { 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++) { |