From patchwork Tue Oct 13 09:10:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 22909 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 30B5B44AFB2 for ; Tue, 13 Oct 2020 12:10:56 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1268668BB09; Tue, 13 Oct 2020 12:10:56 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3AF6668BB06 for ; Tue, 13 Oct 2020 12:10:50 +0300 (EEST) Received: by mail-wr1-f67.google.com with SMTP id i1so16946683wro.1 for ; Tue, 13 Oct 2020 02:10:50 -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=ke+/dk1swxIOVZK04HSNL/pDpO+sF7kYfUjMaXLzNmo=; b=gdOb0P4+gXnpsGk/BPLkx+2u+Vy53Mqe1/q7q/Q14LH1d6v9UPJWAi1xCupdaeOwRe hEcp1crHgUh0+jS4SHS+wJwzLfZdQpZIuAvPgJoAE5gdcxWh1pIE1RywMGAFtztLLXxd 5IutIgfoTItHdPBDt505KSN9fxNIG8bPn95O+mOjKr3mFitwRkfIF0vU+yXuc56amU/C vk2BYF7Rt3GwzGTL0vWnYdOAa6uFA+bkNVEBBAdK8LKFF+lIIrJlfkc8mBzn3Ys0MLeQ +wilTvoAA6eCxJ4JNYAUBGaRg+uYHQgwYYMdCFoiArn5bSaZef8zWSDud//OWUn8IlzH we7Q== 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=ke+/dk1swxIOVZK04HSNL/pDpO+sF7kYfUjMaXLzNmo=; b=F02GOkUY2uTm5uudoU4+Mc97nWKVxhEfeYSR/TWthW02RAJNNPIHj1cNeSWX45k0rw xoM/epoFpYarC90vPo+SCmsiJ0NGp/KlN/DOMsBnqT1JaiBgSbjBevWhZClB9NSgytMt bPzvz3Nf9Pw2cAv6UJnzKIaEtP8FjTSyIQdJXgZ1wADzNZDog+kyXX5b9LuCW4X9ArfH mJDY2N1N+nJIMeRZtuXVdBU2/H+pik63OEoBH2jiGo+SRmpH0djsCuBE+A7HLuj1nFS7 PVZSz4Hc+qkqiRWWezpQ6IfYPdFzJJSUHoM+FvbTHMHbMiVxsWgbKi2lgeTRdfxT88S2 yHUQ== X-Gm-Message-State: AOAM533BlcppiSb59sI9T4SkTWHA8DRZitdB2q+7Jr4d5Sqh0aUYv96g a9LSlkXm1/b0wn7sRJ35ZF7R9wNGxyM= X-Google-Smtp-Source: ABdhPJzJL9CQ/IWFfn2t2dq5BXWwpssuVyCqInBh+oNcflp1pNSPD5ihaVcsvHYA5ZM5BLaz0wvvxw== X-Received: by 2002:a5d:6ac6:: with SMTP id u6mr34030945wrw.65.1602580249136; Tue, 13 Oct 2020 02:10:49 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id g83sm25913159wmf.15.2020.10.13.02.10.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Oct 2020 02:10:48 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 13 Oct 2020 11:10:10 +0200 Message-Id: <20201013091017.1899676-2-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201013091017.1899676-1-andreas.rheinhardt@gmail.com> References: <20201013091017.1899676-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/9] avcodec/asvdec: Use init_get_bits8() 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/asvdec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/asvdec.c b/libavcodec/asvdec.c index a21e4277b3..6198188fc5 100644 --- a/libavcodec/asvdec.c +++ b/libavcodec/asvdec.c @@ -235,7 +235,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, a->bitstream_buffer[i] = ff_reverse[buf[i]]; } - init_get_bits(&a->gb, a->bitstream_buffer, buf_size * 8); + ret = init_get_bits8(&a->gb, a->bitstream_buffer, buf_size); + if (ret < 0) + return ret; for (mb_y = 0; mb_y < a->mb_height2; mb_y++) { for (mb_x = 0; mb_x < a->mb_width2; mb_x++) {