Browse Source

pnmdec: make pnm_get more robust

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n1.0
Michael Niedermayer 13 years ago
parent
commit
bb7744a45b
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      libavcodec/pnm.c

+ 3
- 3
libavcodec/pnm.c View File

@@ -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;
}


Loading…
Cancel
Save