From patchwork Tue Jul 14 20:19:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 21018 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 872BC44A518 for ; Tue, 14 Jul 2020 23:20:37 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7311168AF09; Tue, 14 Jul 2020 23:20:37 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D0BDB68AA4D for ; Tue, 14 Jul 2020 23:20:30 +0300 (EEST) Received: by mail-wr1-f68.google.com with SMTP id z15so24090wrl.8 for ; Tue, 14 Jul 2020 13:20:30 -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=l7NnZ/n35kwcgQbe7d6atG43HnzoPRKNYVdn0aFLZ2A=; b=PUDfidJ54KN0mc21x0P+Txsl/fsSyGsqwyP5BYlgXairzExNmjx+QpGFfhYr1hl5mb 7oqVy3eHINL6ZtINlPw/vogOkeN0O2pnH99AwipcMn1DOw56Z88w/wYJPe5NRUwxMfXx V8xXShI36ckFWcy/bG1J8B1aYQwLNwsg1vRkMZUxAyCBTFu++AFLKORuRpnVcCJau7J+ LwFCVu2CtxFeC4jsvOTr1vjTqCj5JN50tBiw51W2qOZC4/PvSy1UrZ65OWw6VueD8Nv4 aDN0kwa3y4xwcoywDq1PYWOZ/c4f+6JON/TJlgK0IB22gqjytnfi2pG0NS9nSYgcanlk t+uw== 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=l7NnZ/n35kwcgQbe7d6atG43HnzoPRKNYVdn0aFLZ2A=; b=ot5X+M6kvYbQRGu5hcH7qEmICtssQHLl6mHHHDufSMWqw/qKk9P2iLsKYU8Z/Eiaym ln+D3YPD3/yY2zmXLHvttHIJ9nRu78ieZ5AL6d4ANvEYFJtm/eD21OS85f3s2TfKk7DF lVJRpN7W7YZNOHpcwDvW28J4VzK4zMAAfaVvMJsVUWCI74yd+kxo55CRN7AxfG7+0kcI 3uv8x5BQ9sjPfq9hcsWOUvXMb8s6szeBO17yBOEn74G3YPHMRl3eUq+My+f5Jpr5gqUi xQf2QCmvhyA96ToW8zXQtZUYaOO1EKqsUiWWn3gceokb03T39BCWNsuAZtn/chaO1EC3 OeiQ== X-Gm-Message-State: AOAM53010iX+1ac9Lje3ZK2M3CNV3PmkatFUtDspux3Mxj3IM8c7b1hS /EAP1a/I8XI+pCsvBWW3RZqim27S X-Google-Smtp-Source: ABdhPJyle2sGxDO3Xf5IDmI62eQksiSgHSLmQjsyYdmnP3LHdrtEHDJIERTtZt7KIzAYhoVkdFkV8w== X-Received: by 2002:adf:9404:: with SMTP id 4mr7551197wrq.367.1594758029984; Tue, 14 Jul 2020 13:20:29 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc10296.dynamic.kabel-deutschland.de. [188.193.2.150]) by smtp.gmail.com with ESMTPSA id j15sm29462355wrx.69.2020.07.14.13.20.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jul 2020 13:20:28 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 14 Jul 2020 22:19:52 +0200 Message-Id: <20200714201954.30327-4-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200714201954.30327-1-andreas.rheinhardt@gmail.com> References: <20200714201954.30327-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 4/6] avcodec/golomb: Document return value of get_ue_golomb_30 on error 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" If the return value is undefined if the value of the encountered exp golomb code was outside the 0..30 range, said function can't be used anywhere where one wants to check for correctness. So document that in this case the return value is outside the range 0..30 (it currently always returns 32 in this case). Signed-off-by: Andreas Rheinhardt --- libavcodec/golomb.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/golomb.h b/libavcodec/golomb.h index 775ac9878d..356df2cd92 100644 --- a/libavcodec/golomb.h +++ b/libavcodec/golomb.h @@ -115,7 +115,8 @@ static inline unsigned get_ue_golomb_long(GetBitContext *gb) /** * Read unsigned exp golomb code, constraint to a max of 30. - * the return value is undefined if the stored value exceeds 30. + * The return value is outside 0..30 if no exp golomb code + * in that range was encountered. */ static inline int get_ue_golomb_30(GetBitContext *gb) {