diff options
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/pnm.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/pnm.c b/libavcodec/pnm.c index bfb4a25b7c..a20051e200 100644 --- a/libavcodec/pnm.c +++ b/libavcodec/pnm.c @@ -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; } |