From patchwork Wed Dec 2 04:22:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 24309 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 03D6544A7AC for ; Wed, 2 Dec 2020 06:35:36 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6AAE868A697; Wed, 2 Dec 2020 06:24:38 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ed1-f66.google.com (mail-ed1-f66.google.com [209.85.208.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CAF1B68A42C for ; Wed, 2 Dec 2020 06:24:30 +0200 (EET) Received: by mail-ed1-f66.google.com with SMTP id q16so1141338edv.10 for ; Tue, 01 Dec 2020 20:24:30 -0800 (PST) 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:reply-to :mime-version:content-transfer-encoding; bh=JTF4mURE97ZJiji3CesrzHOisQXPgywq3jjlA5917iE=; b=QENDwlxHWm12p5dk5Au2z+Y2UqxBMD7sLYZ0WqAstehlOJPsnv6zll2tQgLpiGglEm HPc0G77TCvfE7xbxmPkdPgYEwDLMjBMyIAn0QA/LQKVjoJGpv0jE/M27VOFL8/QPbLNl SYBDtRPe7G1mId9sxTTdjCDP3asYajmn2rnPeiAKgyCfPW37yF08eZFExuujMOhB04YG sZVIHdbcTmIQthKH0yRTSGDILEfCJ3YU97QVmqK89gUCsvUP4lcPydIj1+FKvMXPhEzy J7WcCPrJkHw/oFmekVUzKP1XpvLQAy6x0c7YCloJmE2abxJV0s0f2PXEfSh9V0N30637 zeqg== 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:reply-to:mime-version:content-transfer-encoding; bh=JTF4mURE97ZJiji3CesrzHOisQXPgywq3jjlA5917iE=; b=gdJFR9RBIUaiqPq8uNdLlO81m3cj6CQWXEML/p8YkWkJzZSkyFjOr8fn1PUlTPIfld 5FUCPTH18ilssfNPFn1+c00rsI8PQ4rQof6FFg+TGSy2mDxuX6vEOMEo38iLTkt+Tbmg rcZuwqL7BOvemnBPd5AcbWaTtaeFRMuoOlaOrR20V7U1wJX909K9jgIKLQ0EqiyJ36Jq NowE2qVvncZAXTaqIxni4fliHZtQz+D8UVADpbh/+4xzZlxGvLzQk5eiCJBYZ3nNqJSy oo5vAEku6SGmrA4dsQ/8wpyHZsKY4lJWFTiRF/KBSs6qSJp3S3vj+Hq46HHyLzQTKS0C Xjqg== X-Gm-Message-State: AOAM532cwpV5o2zI+pk6ZsmtmFrd2yB6XJl7saPz14whQ64qaX+k8U3C IJw2b6xa/zT9m/Z06BtDQXrX0oRySWM7cQ== X-Google-Smtp-Source: ABdhPJyQ8KmBsauWNt9lmVxexqRvOVdl5yHVFr2hNHhKhRJV10zhBnUja/bBfJEki4SArzODZ73Q2g== X-Received: by 2002:a50:e0ce:: with SMTP id j14mr865949edl.18.1606883070121; Tue, 01 Dec 2020 20:24:30 -0800 (PST) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id mc25sm265087ejb.58.2020.12.01.20.24.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2020 20:24:29 -0800 (PST) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Wed, 2 Dec 2020 05:22:32 +0100 Message-Id: <20201202042244.519127-71-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201127010249.2724610-1-andreas.rheinhardt@gmail.com> References: <20201127010249.2724610-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 205/217] avcodec/dvbsubdec: Add const where appropriate 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" These pointers sometimes point to static storage (namely to default_clut), so adding const to the pointed-to type is important to ensure that one does not accidentally modify something that is not owned by a single AVCodecContext. Signed-off-by: Andreas Rheinhardt --- libavcodec/dvbsubdec.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c index 9bee33e4a2..b1a0c3ff24 100644 --- a/libavcodec/dvbsubdec.c +++ b/libavcodec/dvbsubdec.c @@ -724,8 +724,8 @@ static int save_subtitle_set(AVCodecContext *avctx, AVSubtitle *sub, int *got_ou DVBSubDisplayDefinition *display_def = ctx->display_definition; DVBSubRegion *region; AVSubtitleRect *rect; - DVBSubCLUT *clut; - uint32_t *clut_table; + const DVBSubCLUT *clut; + const uint32_t *clut_table; int i; int offset_x=0, offset_y=0; int ret = 0; @@ -1454,8 +1454,8 @@ static int save_display_set(DVBSubContext *ctx) { DVBSubRegion *region; DVBSubRegionDisplay *display; - DVBSubCLUT *clut; - uint32_t *clut_table; + const DVBSubCLUT *clut; + const uint32_t *clut_table; int x_pos, y_pos, width, height; int x, y, y_off, x_off; uint32_t *pbuf;