]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/pnm_parser: Factor next initialization out
authorMichael Niedermayer <michael@niedermayer.cc>
Sat, 6 Apr 2019 12:41:33 +0000 (14:41 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Wed, 10 Apr 2019 20:33:38 +0000 (22:33 +0200)
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/pnm_parser.c

index e3bfa3c490fd190658de33cd857e74bd367670bd..91a9edc0160133258cbc2c69170ea0482800b543 100644 (file)
@@ -47,6 +47,7 @@ retry:
         pnmctx.bytestream       = (uint8_t *) buf + skip; /* casts avoid warnings */
         pnmctx.bytestream_end   = (uint8_t *) buf + buf_size - skip;
     }
+    next = END_NOT_FOUND;
     if (ff_pnm_decode_header(avctx, &pnmctx) < 0) {
         if (pnmctx.bytestream < pnmctx.bytestream_end) {
             if (pc->index) {
@@ -58,12 +59,10 @@ retry:
             }
             goto retry;
         }
-        next = END_NOT_FOUND;
     } else if (pnmctx.type < 4) {
               uint8_t *bs  = pnmctx.bytestream;
         const uint8_t *end = pnmctx.bytestream_end;
 
-        next = END_NOT_FOUND;
         while (bs < end) {
             int c = *bs++;
             if (c == '#')  {