forked from old/legacy-imlib2
pnm loader more paranoid about pnm format checks
SVN revision: 3687
This commit is contained in:
parent
f7e6af37c5
commit
14f104ac97
|
@ -52,6 +52,11 @@ load(ImlibImage * im, ImlibProgressFunction progress,
|
||||||
if (p == '1' || p == '4')
|
if (p == '1' || p == '4')
|
||||||
numbers = 2; /* bitimages don't have max value */
|
numbers = 2; /* bitimages don't have max value */
|
||||||
|
|
||||||
|
if ((p < '1') || (p > '8'))
|
||||||
|
{
|
||||||
|
fclose(f);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
count = 0;
|
count = 0;
|
||||||
while (count < numbers)
|
while (count < numbers)
|
||||||
{
|
{
|
||||||
|
@ -106,6 +111,13 @@ load(ImlibImage * im, ImlibProgressFunction progress,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ((w <= 0) || (w > 8192) ||
|
||||||
|
(h <= 0) || (h > 8192) ||
|
||||||
|
(v < 0) || (v > 255))
|
||||||
|
{
|
||||||
|
fclose(f);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
im->w = w;
|
im->w = w;
|
||||||
im->h = h;
|
im->h = h;
|
||||||
|
|
Loading…
Reference in New Issue