From patchwork Fri Nov 25 20:18:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 39449 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:999a:b0:a4:2148:650a with SMTP id ve26csp5684764pzb; Fri, 25 Nov 2022 12:18:45 -0800 (PST) X-Google-Smtp-Source: AA0mqf7P+WJNys1LQJRbEaoH2kQ00JGOpdwhOsape18cXMA38lwJtarLh6hLq1+y44Qfvxzf6NRa X-Received: by 2002:a17:907:a709:b0:79f:cd7c:e861 with SMTP id vw9-20020a170907a70900b0079fcd7ce861mr32816732ejc.339.1669407525238; Fri, 25 Nov 2022 12:18:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669407525; cv=none; d=google.com; s=arc-20160816; b=XTSDy8gGAyyE2wReyM+CJ7TtwDaaxMJ+7MCEcScM5yjlOVU7uyDhCRgUIls5s9GyQd x7RaWrl3czu6k6Ud3ii2h4tDEIhZX8PZA+Jxn51ix/jZM+ysuWWfYMeEfeBJ9HFeI81B hLAEdzbCD66bbBJOKz5Xfvt433hYDGCSgVd83rD/Jwex56hBRtUHr5bzMiQGnQ9g1sVU 4yC1G/6VJq4rRBMm+f3+xv9Rf/6Ql6O+guq5L0SHx5NB+mqGKz9u96IGFE5IH943OqbZ xbhG1aOcd9w+a+CR95dVr9BzapWq2eyDFsmScpdKFhQSZOLECTiyd59GTmmPgCxMT9f8 CJWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:delivered-to; bh=HTafzVT2d7MQ6a2x8GiH5E1uAq1/Do6h7U1uNDES3zI=; b=gI4xK83n1vCrZgssjbGQyALjj12Hw96pwp8Vulomf2XpQYoca4xyTNs+V1fi4BUh/w vjq0arEv9KnHQvnnA4HC6gP8A9Wj9V1LB7nIGnB9xoR90yotmpwTJPhrmHyjG/Ff4HWo utDIm3aWYuuiLWnkYms6E0/8luGrPyepQAAfpwwizTtd5t9A0qQ5LF7ykD5PXoX3ItjA sG3SWAtkiczWVqZHGVuOPlQjK7ZVSC2faynLtqHAl3E8M1QjgKJFgF/+2zlvm0d3sGP9 LyXcFHeBILl0rgg63gVH+k0N9nGQEfxBSDeT0r/QMjb+MIRWW/NBXV7qZxp6dIk8vK8c lfZw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id p20-20020a1709060dd400b007a0b28c324esi2953743eji.1008.2022.11.25.12.18.44; Fri, 25 Nov 2022 12:18:45 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AF82468BCF8; Fri, 25 Nov 2022 22:18:41 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0509A68BBF9 for ; Fri, 25 Nov 2022 22:18:34 +0200 (EET) Received: (Authenticated sender: michael@niedermayer.cc) by mail.gandi.net (Postfix) with ESMTPSA id 1A94540003 for ; Fri, 25 Nov 2022 20:18:33 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 25 Nov 2022 21:18:33 +0100 Message-Id: <20221125201833.20355-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 Subject: [FFmpeg-devel] [PATCH] avcodec/pictordec: Remove mid exit branch X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: cpt+dUdq+2Lh This causes the RLE decoder to exit before applying the last RLE run All images i tested with are unchanged, this makes the special case for handling the last run unused for non truncated images. Signed-off-by: Michael Niedermayer --- libavcodec/pictordec.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libavcodec/pictordec.c b/libavcodec/pictordec.c index 09229b94fd..27f5b96571 100644 --- a/libavcodec/pictordec.c +++ b/libavcodec/pictordec.c @@ -246,8 +246,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame, run = bytestream2_get_le16(&s->g); val = bytestream2_get_byte(&s->g); } - if (!bytestream2_get_bytes_left(&s->g)) - break; if (bits_per_plane == 8) { picmemset_8bpp(s, frame, val, run, &x, &y);