From patchwork Fri Jul 31 11:22:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 21403 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 A5B9244998B for ; Fri, 31 Jul 2020 14:23:34 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8EB8F68B82F; Fri, 31 Jul 2020 14:23:34 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f66.google.com (mail-ej1-f66.google.com [209.85.218.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3CDFF68B81D for ; Fri, 31 Jul 2020 14:23:28 +0300 (EEST) Received: by mail-ej1-f66.google.com with SMTP id a21so31051916ejj.10 for ; Fri, 31 Jul 2020 04:23:28 -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=1mPHKC4AMB3xvAnq24IXgXrU30wq5+j+Nah3pvALOOE=; b=sJGBjEtAiXdTPxsnO60n01H9tNuRrz12LrFuY8xAEFkm2E0aigs5erq2L06EpCoDEi xj8sWpMHlJanWSKtkiuXtdGF/70W+M3OIxgzx/CIOJd70cH5QFxTgcRA5xcj5ok1GxgQ jXf9RRkPq3feGBo3QlBcokyCX4srCLOa8DTub5Fx+ESP8yVWOStoXCkLi/dgEi+C9YYV upQ3zgd8ZiC3qqiQWbupnORnFOI85Aq9eztkpZz2Vcd5wVK/co9vXGj7azgvWgvDXKxV MZRqZ+cKl6aG2rxGtGySSwqNtk94htjyiU5YIZ5J1fJs9lNKIh1vQ2gd8H3eBytxkv22 1Yjw== 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=1mPHKC4AMB3xvAnq24IXgXrU30wq5+j+Nah3pvALOOE=; b=fMkpuJe7oneuebk264B5y8fMyUonc3tnRF5bSZXus+A8b3QHgHqLcFzWm7VXL3J40H eSk4xiiG11Zb6Im7ZumZO8YpvCb8KlJd+pauSkx1RONmytTzNKF9LElADf5T8OjMf78S TYKmF0IdGDI3unxNjpWnkan8sFG1K9Rp8ef6kk05lOvYGoL7yLGawYb3s/3xeaZaB9jt 7QKkNv9huB332rtvjBSRua4I3iKgtnVA8lrKhAUkJw9CN8+XErPDBDLBLJ3aTGsVkVKw oflgur+IwqTf1je4567HCYpdvhNYNLtagwaSMEgOdxm6lWekVeAsvkkbtxX9z21vPa0/ fX8A== X-Gm-Message-State: AOAM531gTn+oEnR3rkfzL4QABeVNdEk9OCgqq36seYLUO+2OVuUUpN14 5S03x/+bIBADGCDXC4JdE53w9xJ+ X-Google-Smtp-Source: ABdhPJwXyJ7MR1FqmFuuSIp4ZJjcmaRBRzsUVs/ONbiLB4c3e5DhRpPUmcH6wlLMmwmsDoplfI4WqA== X-Received: by 2002:a17:906:5246:: with SMTP id y6mr3484496ejm.316.1596194607315; Fri, 31 Jul 2020 04:23:27 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc10296.dynamic.kabel-deutschland.de. [188.193.2.150]) by smtp.gmail.com with ESMTPSA id v22sm9284279edq.35.2020.07.31.04.23.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Jul 2020 04:23:26 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 31 Jul 2020 13:22:35 +0200 Message-Id: <20200731112241.8948-2-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200731112241.8948-1-andreas.rheinhardt@gmail.com> References: <20200731112241.8948-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/8] avcodec/smacker: Don't warn for Huffmann tables with one element 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" The Huffmann tables used by Smacker can consist of exactly one leaf only in which case the length of the corresponding code is zero; there is then exactly one value encoded. Our VLC can't handle this and therefore this case needs to be treated separately; it has been implemented in commit 48cbdaea157671d456750e00fde37c6d7595fad6. Yet said commit also made the decoder emit an error message (despite not erroring out) in this case, although it seems that this is rather a limitation of our VLC API. Signed-off-by: Andreas Rheinhardt --- libavcodec/smacker.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c index e53183318e..3c9f118fb7 100644 --- a/libavcodec/smacker.c +++ b/libavcodec/smacker.c @@ -229,8 +229,7 @@ static int smacker_decode_header_tree(SmackVContext *smk, GetBitContext *gb, int goto error; } } - } - if (!vlc[0].table) { + } else { av_log(smk->avctx, AV_LOG_ERROR, "Skipping low bytes tree\n"); } if(get_bits1(gb)){ @@ -250,8 +249,7 @@ static int smacker_decode_header_tree(SmackVContext *smk, GetBitContext *gb, int goto error; } } - } - if (!vlc[1].table) { + } else { av_log(smk->avctx, AV_LOG_ERROR, "Skipping high bytes tree\n"); }