forked from old/legacy-imlib2
XPM loader: Accept signature not at the very start of the file
This commit is contained in:
parent
484bd5cc79
commit
7a2769cad7
|
@ -125,13 +125,14 @@ load(ImlibImage * im, ImlibProgressFunction progress, char progress_granularity,
|
||||||
if (!f)
|
if (!f)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (fread(s, 1, 9, f) != 9)
|
if (fread(s, 1, sizeof(s) - 1, f) < 9)
|
||||||
|
goto quit;
|
||||||
|
|
||||||
|
s[sizeof(s) - 1] = '\0';
|
||||||
|
if (!strstr(s, " XPM */"))
|
||||||
goto quit;
|
goto quit;
|
||||||
|
|
||||||
rewind(f);
|
rewind(f);
|
||||||
s[9] = 0;
|
|
||||||
if (strcmp("/* XPM */", s))
|
|
||||||
goto quit;
|
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
j = 0;
|
j = 0;
|
||||||
|
|
Loading…
Reference in New Issue