From patchwork Fri Oct 23 20:54:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23187 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 5F12F44B5CA for ; Fri, 23 Oct 2020 23:55:34 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4B1C968A3EE; Fri, 23 Oct 2020 23:55:34 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id ECA49689A91 for ; Fri, 23 Oct 2020 23:55:26 +0300 (EEST) Received: by mail-wm1-f68.google.com with SMTP id c16so3526745wmd.2 for ; Fri, 23 Oct 2020 13:55:26 -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=AbhKhOdlcDD5vAKMntBa53JiD6uICIsnR2w0RlcT+34=; b=YxVaey1cp5bCniXNTcUs9bTn9lZpCsPwLxVhPh+lTlk1OAJI4q6/BUxZQECYSHp5Pu 0FJtbaDcTOMKNHRkPR7YDgVvI1jC3gpACMscMkvt/Fi5lVD6yDohaMd2IpMD2CO4t9T1 +nGra9+ORzCjY1xoyxTqJ39de8Ov79HZZm/B8Q22bNdtzG9HLXFTyzVbTBwgiZxbZ1Xo m3b4lb9PD7b1ZV/9N2bbgvTkk8WLFdQtbzd/UayJw5kOoj4+9PTfLm7eWJC26w0QzjEx WIfjtPj+w00TZJzUyQcFi52ufkMYBUO4wK0OECDSmiL+hYTzW9TMQ4YZ+gwAiqWLuFhd EBXA== 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=AbhKhOdlcDD5vAKMntBa53JiD6uICIsnR2w0RlcT+34=; b=hLGXsZHcyJflXJM2vlysDinXVkOkqg9xHbMEEGQKIY5cnBdKly3JfaVXbb4Iy3nIrO Tb1/Yp46BvwCkX0D5dCDKVGRl8QmUrbGW8FTXJ2ipljr8cLJhplYgE9khBBigZ9hJc/s 7L4IDnm3sHntrAfcCrewdnCBIIXQO6AtaSwr1HZFhJvxraWYFhGY+VXy3Tx/l/W6nQ2I t1mI5gc27V/GeKkE8TgOEG54AIlexSGS1y7ghrltKCICxv1A1wLrPuuhTVeUAZ/IAHyb tKJtpLOr3BYhOgarCX2tqKvE9oonBZpshT315pQl6BVBBX6ZSuWJaUsB6BLpQwgBGYYK qYBA== X-Gm-Message-State: AOAM532zbOkN54RQYAG0v1Jm8TUCyx7Wp8t4wwtjVyskC4tTWw2YRjSJ Z2rxCJMC0BYqCnMDkOJ/OZE2NPtMVug= X-Google-Smtp-Source: ABdhPJyTx0C7THSyHPU5tsRER5xz0M/edcuOIOnfYSy0pYQvFoXFTutNwPvBw5VY5mvy2IX5FMCdGA== X-Received: by 2002:a05:600c:2115:: with SMTP id u21mr3921522wml.2.1603486526179; Fri, 23 Oct 2020 13:55:26 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id z6sm5153350wmi.28.2020.10.23.13.55.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Oct 2020 13:55:25 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 23 Oct 2020 22:54:53 +0200 Message-Id: <20201023205454.851696-3-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201023205454.851696-1-andreas.rheinhardt@gmail.com> References: <20201023205454.851696-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/4] avcodec/mpeg4videodec: Use smallest max_depth in get_vlc2() 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 longest code here is 12 bits long and can be read in two attempts. Signed-off-by: Andreas Rheinhardt --- libavcodec/mpeg4videodec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c index 95a0e63a29..c26ad616b8 100644 --- a/libavcodec/mpeg4videodec.c +++ b/libavcodec/mpeg4videodec.c @@ -203,14 +203,14 @@ static int mpeg4_decode_sprite_trajectory(Mpeg4DecContext *ctx, GetBitContext *g int length; int x = 0, y = 0; - length = get_vlc2(gb, sprite_trajectory.table, SPRITE_TRAJ_VLC_BITS, 3); + length = get_vlc2(gb, sprite_trajectory.table, SPRITE_TRAJ_VLC_BITS, 2); if (length > 0) x = get_xbits(gb, length); if (!(ctx->divx_version == 500 && ctx->divx_build == 413)) check_marker(s->avctx, gb, "before sprite_trajectory"); - length = get_vlc2(gb, sprite_trajectory.table, SPRITE_TRAJ_VLC_BITS, 3); + length = get_vlc2(gb, sprite_trajectory.table, SPRITE_TRAJ_VLC_BITS, 2); if (length > 0) y = get_xbits(gb, length);