mirror of
https://github.com/mpv-player/mpv
synced 2025-03-20 18:28:01 +00:00
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
This commit is contained in:
parent
0636ab5f58
commit
d359f1537c
@ -121,10 +121,10 @@ static int demux_gif_fill_buffer(demuxer_t *demuxer, demux_stream_t *ds)
|
|||||||
{
|
{
|
||||||
int y;
|
int y;
|
||||||
int cnt = FFMIN(effective_map->ColorCount, 256);
|
int cnt = FFMIN(effective_map->ColorCount, 256);
|
||||||
int l = FFMIN(gif->Image.Left, priv->w);
|
int l = FFMAX(FFMIN(gif->Image.Left, priv->w), 0);
|
||||||
int t = FFMIN(gif->Image.Top, priv->h);
|
int t = FFMAX(FFMIN(gif->Image.Top, priv->h), 0);
|
||||||
int w = FFMIN(gif->Image.Width, priv->w - l);
|
int w = FFMAX(FFMIN(gif->Image.Width, priv->w - l), 0);
|
||||||
int h = FFMIN(gif->Image.Height, priv->h - t);
|
int h = FFMAX(FFMIN(gif->Image.Height, priv->h - t), 0);
|
||||||
|
|
||||||
// copy the palette
|
// copy the palette
|
||||||
for (y = 0; y < cnt; y++) {
|
for (y = 0; y < cnt; y++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user