Commit bb7744a4 authored by Michael Niedermayer's avatar Michael Niedermayer

pnmdec: make pnm_get more robust

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 9b34ae4a
......@@ -34,12 +34,12 @@ static void pnm_get(PNMContext *sc, char *str, int buf_size)
int c;
/* skip spaces and comments */
for (;;) {
while (sc->bytestream < sc->bytestream_end) {
c = *sc->bytestream++;
if (c == '#') {
do {
while (c != '\n' && sc->bytestream < sc->bytestream_end) {
c = *sc->bytestream++;
} while (c != '\n' && sc->bytestream < sc->bytestream_end);
}
} else if (!pnm_space(c)) {
break;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment