From patchwork Sat Apr 6 23:21:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 12626 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id A3B804479F5 for ; Sun, 7 Apr 2019 02:23:45 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8233D68A9B7; Sun, 7 Apr 2019 02:23:45 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe07-2.mx.upcmail.net (vie01a-dmta-pe07-2.mx.upcmail.net [84.116.36.18]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C931C68A9A0 for ; Sun, 7 Apr 2019 02:23:38 +0300 (EEST) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-pe07.mx.upcmail.net with esmtp (Exim 4.91) (envelope-from ) id 1hCuew-0005WF-1U for ffmpeg-devel@ffmpeg.org; Sun, 07 Apr 2019 01:23:38 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id Cudxhr767xLwqCudxh11V2; Sun, 07 Apr 2019 01:22:37 +0200 X-Env-Mailfrom: michael@niedermayer.cc X-Env-Rcptto: ffmpeg-devel@ffmpeg.org X-SourceIP: 213.47.41.20 X-CNFS-Analysis: v=2.3 cv=WaxylHpX c=1 sm=1 tr=0 a=I1eytVlZLDX1BM2VTtTtSw==:117 a=I1eytVlZLDX1BM2VTtTtSw==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=ZZnuYtJkoWoA:10 a=XE-52I_T8ulSDb8WOsoA:9 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 7 Apr 2019 01:21:12 +0200 Message-Id: <20190406232114.12961-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 X-CMAE-Envelope: MS4wfH1qY2/LuhT6EN8SFpNsQVH7M8JC+mJUVKXIUANHXrbePmjLDAAWqNiuHJQ0vnL6SPWrQmpbhaLRIbFwzrHAOql+9i4pjxU0R+kOX1+JSD3Aza3aAWWf q8tLFMEG6OOn7z7pKUhI3WZvsZUiMGY5J1m54yqpMJjmYWkaXHM51Rfk Subject: [FFmpeg-devel] [PATCH 1/3] avcodec/pnm_parser: Factor next initialization out X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Michael Niedermayer --- libavcodec/pnm_parser.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavcodec/pnm_parser.c b/libavcodec/pnm_parser.c index e3bfa3c490..91a9edc016 100644 --- a/libavcodec/pnm_parser.c +++ b/libavcodec/pnm_parser.c @@ -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 == '#') {