From patchwork Thu Oct 22 14:56:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23152 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 31D2544A65A for ; Thu, 22 Oct 2020 17:57:47 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1E29068AE9A; Thu, 22 Oct 2020 17:57:47 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 144C668AA85 for ; Thu, 22 Oct 2020 17:57:40 +0300 (EEST) Received: by mail-wm1-f65.google.com with SMTP id a72so2431806wme.5 for ; Thu, 22 Oct 2020 07:57:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=V93Hkx3Bpneck+NbrjDohR4j8U+kKzavlu1HaPO2yHE=; b=iEVETG0m5Zw5k3S39mXOMNGFEY49IKD8T7wFcs25cvWFpYFfO2YeOyXXU1sQfpUqgO xGdaz2owl1U4AnB7JjHJY3IObJJF22CAS2c93v9kiEL3S9E/10PIHS4S3U0UfVRt4dWR fgEmaZkp/rrqlvpR+diouxOWVM0fYpZ3qyg8D1MU+tCgU//25OfxikJ2JFIVY1bCgTy8 bOJXajBt08I/K8IyV510a9FbRx5UTVs2GaZpK3sSxqcHtB4REJBCNncV83D9q/GcAM/D JHQ7MBdoaVBr5x9iY20j7L+oDnOgZTmucSkb3KumTIwjK6975mJoa78HVhAfn7fkB4gQ vN9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=V93Hkx3Bpneck+NbrjDohR4j8U+kKzavlu1HaPO2yHE=; b=t+8WR/y7WgTvDHhnTq0OYTEtFgl0PNjWhUK5EJUl3j78qetcGdrP9vZzqEERCWN5dK ofNZRstG6vnP8wH1GIl4F6k6P1zrE621RKZdM2mndNMa7z12gh9km29sw3LBLcSCX1vp 7wxBJQk3ejD0Lti4QLJhhoByiJumDlVcJXSdl6VCOexmq9gUMF+rJy5jDfY9a+2JZVLi BBYHnHeYgCKsVjOeYz9dgVLaoTQ3ONrBAHnglU+f7/z+IAhRScGqSl1pMR69t9a5+byX j/dd27CoOmd7jt1uLw4OaeAWKewPlig1f6IgRbSM4j/9RjphnqVkTPy2i4e3HY5rG2jN VR+w== X-Gm-Message-State: AOAM530DEV+qb/MH3wx2K9/A7flCLTaVtV8MYE5P965UK5l/of1ijjb3 4IYDEGoNnjx+I/IwZSvH+yQB2bWVt7A= X-Google-Smtp-Source: ABdhPJwyI9B5quFMOOVZv5a33/wXW1XTb5uEuqsl+XHUhwqlwCbZqPr1CP1gz0iOgiS1n3kA6O3kRw== X-Received: by 2002:a1c:2402:: with SMTP id k2mr2867236wmk.158.1603378659306; Thu, 22 Oct 2020 07:57:39 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id a3sm4711652wrh.94.2020.10.22.07.57.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Oct 2020 07:57:38 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 22 Oct 2020 16:56:24 +0200 Message-Id: <20201022145624.657457-3-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201022145624.657457-1-andreas.rheinhardt@gmail.com> References: <20201022145624.657457-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/3] avcodec/webp: Replace never-true check by assert 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 Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Andreas Rheinhardt --- libavcodec/webp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libavcodec/webp.c b/libavcodec/webp.c index 549d125dcc..6de6a5c036 100644 --- a/libavcodec/webp.c +++ b/libavcodec/webp.c @@ -329,8 +329,7 @@ static int read_huffman_code_normal(WebPContext *s, HuffReader *hc, int i, symbol, max_symbol, prev_code_len, ret; int num_codes = 4 + get_bits(&s->gb, 4); - if (num_codes > NUM_CODE_LENGTH_CODES) - return AVERROR_INVALIDDATA; + av_assert1(num_codes <= NUM_CODE_LENGTH_CODES); for (i = 0; i < num_codes; i++) code_length_code_lengths[code_length_code_order[i]] = get_bits(&s->gb, 3);