From patchwork Tue Jul 14 15:34:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 21006 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 17BDB44AA50 for ; Tue, 14 Jul 2020 18:35:19 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0461A68B2DB; Tue, 14 Jul 2020 18:35:19 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1520368AA69 for ; Tue, 14 Jul 2020 18:35:11 +0300 (EEST) Received: by mail-wr1-f65.google.com with SMTP id z15so22527017wrl.8 for ; Tue, 14 Jul 2020 08:35:11 -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=RuaD2Lzgo1eGh3qYpJiAg6bze1v218sL6ohazntrjkg=; b=sumAdqABQjeo4NrNaPTDT6bm6hcChuqMw7VqiXpFkfYmBBD/1jUzlUY4hhjjgE/b4Z 3WbEz3AFwvWgJiAF2EXlHO8v9XVRfrnveCNhN2GqDlsncpVMpmY1wVD57Tlf3Vmt7epE 1pUD+lBO/ckyphYeJ+T0sm0wlrSR+EpK49gBQo/9IvVWvb9xCdvx6GosTqHefNw2b0fC i4rOyu/XzofNPN6db/nErAeCVVegkkyi8z+mOfViZQkNQPdxsMMj0rYyLBFPPgv+LvzH Y9qJTm2pHXnjkzgzXiRN8WGA8DSrrg42Nt4oD3mIPhEnoAXFJG0LZffCDEWYVu97isIU 8UGQ== 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=RuaD2Lzgo1eGh3qYpJiAg6bze1v218sL6ohazntrjkg=; b=rmbZeqYIcJUh0/FWFWuxkkmpIRN3abHi+73jipe3+z3by7zMYLE6G6IQIzZCvxG/8k npJzUQKO5om6sf3f/ryLZ9ksQcS/8ef2oTEi1k5gC9U8PQLapGwGvvYn3N6EGFs1R6Kx sfSpWFsFmSn5G+autP4pzAmvwqxnEvkhW9H4H888szm/z8spEO6kt6JqNPLgFMq6WXhC 8MjXGunNlNqXontsakUbLqo8asktUA6XUAXddaOw1o++Um1g9g+BMpa+sLdLB5O28j+N FTade7Iz2kdDb/suGOBI8O1FUX4rbzWz1+xhU8GfK4FeqRBBSN+DGXHKFHgYVExMVFG1 11sQ== X-Gm-Message-State: AOAM5330y391Ivh0GQ191L8D45twTeBfUGrEPPS7qyVZUebzLIGEvSgq rJjZ7Z57Y9vEWrHluRV/o6xemR9U X-Google-Smtp-Source: ABdhPJwHyAo9evyi07ZxH1fxDvR3iMkL9B5SVPVcIfkKS+n0S6GDV2UXa4WJNm+XrElLzCkk+zcJOA== X-Received: by 2002:a5d:688d:: with SMTP id h13mr6284781wru.303.1594740910209; Tue, 14 Jul 2020 08:35:10 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc10296.dynamic.kabel-deutschland.de. [188.193.2.150]) by smtp.gmail.com with ESMTPSA id w14sm29545452wrt.55.2020.07.14.08.35.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jul 2020 08:35:09 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 14 Jul 2020 17:34:51 +0200 Message-Id: <20200714153454.9354-3-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200710134803.4347-1-andreas.rheinhardt@gmail.com> References: <20200710134803.4347-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/7] 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 --- Btw: get_ue_golomb_30() could be used to skip exp golomb codes with length <= 17 bits. libavcodec/golomb.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/golomb.h b/libavcodec/golomb.h index 172d9934e0..8b69196d44 100644 --- a/libavcodec/golomb.h +++ b/libavcodec/golomb.h @@ -135,7 +135,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 the range of 0..30 if no exp golomb code + * in that range was encountered. */ static inline int get_ue_golomb_30(GetBitContext *gb) {