pnmdec: make pnm_get more robust
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
9b34ae4a65
commit
bb7744a45b
@ -34,12 +34,12 @@ static void pnm_get(PNMContext *sc, char *str, int buf_size)
|
|||||||
int c;
|
int c;
|
||||||
|
|
||||||
/* skip spaces and comments */
|
/* skip spaces and comments */
|
||||||
for (;;) {
|
while (sc->bytestream < sc->bytestream_end) {
|
||||||
c = *sc->bytestream++;
|
c = *sc->bytestream++;
|
||||||
if (c == '#') {
|
if (c == '#') {
|
||||||
do {
|
while (c != '\n' && sc->bytestream < sc->bytestream_end) {
|
||||||
c = *sc->bytestream++;
|
c = *sc->bytestream++;
|
||||||
} while (c != '\n' && sc->bytestream < sc->bytestream_end);
|
}
|
||||||
} else if (!pnm_space(c)) {
|
} else if (!pnm_space(c)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user