From patchwork Sat Oct 17 07:37:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 23028 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 BA22F44A037 for ; Sat, 17 Oct 2020 10:37:59 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 92AD468B8AF; Sat, 17 Oct 2020 10:37:59 +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 120D368B5C2 for ; Sat, 17 Oct 2020 10:37:53 +0300 (EEST) Received: by mail-wr1-f67.google.com with SMTP id s9so5889959wro.8 for ; Sat, 17 Oct 2020 00:37:53 -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:mime-version :content-transfer-encoding; bh=QYeMuu6BXS8jJW21Nl47vih+VrDFy8ajMEs+BD8Q6UM=; b=rHhPNTqXkJjvasLHeC7aOG+nf1kFCGu9UHeQ9CPId8iVj1AZTKyNJgRVAKPHgB8QvP hGNpWhPvKbhUCuS+CgcJ3jC8LOFwv78lknagq2PgeY9VYbtfRoYYOiPv1FyXbwL+E+Hc Bgvg5Wspww7fidCjt0PeyTl93Z2JZHt2lmLkIhVNhuvxnMtr07H0JoS7O7ZnI/OeCOeA vc6jFY5PJ02g/K+ezWsysHdc1SBPMEsK3QXrEdgtakJtG2KnXVgRbwCEcmg1QIQ+0nLp E6qWm4mgaqntpG4LYp8AKkbFRbKVqgRxforA9P67W19kjrPo1bGfwPzQOF2ZH5rMUg8x nXmg== 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:mime-version :content-transfer-encoding; bh=QYeMuu6BXS8jJW21Nl47vih+VrDFy8ajMEs+BD8Q6UM=; b=tiojbYhJwhgrHSyVw9oFQtTfL0pf+Tf24f2TRmAK1zWFIDc84gxREJadaC0y6yQgjG X8fzlQuwu95dKLrw+NTgLi+Y4YmfiRL2cCufhf+9ESL2AGqbw7f5vXVo5jAEaQEm2r4f R/5MA6P/LFdwuBvWF9pmgX1fpPc4GyTyvXtm53GokfgrfN7elouD1+bevw+zv1fklQdm XaeZSyCwOKP2EvLd8JlpnwGT3IcYFMWca+npbtVvAAmGR0IdzTZEmWkpWrBi5w+GKEbV wsxBmdNplFfDYQumxLXTtgT1333SNzpNOT3KCzQXcMuSyngBKTgFWx5GgqEQosUtg2nw K+bA== X-Gm-Message-State: AOAM532Wqoe7h2XQKwfRhDqupr/k/zR3O19WNETPO53H/1k1qkKr1+UL 8iZGv9PjgZGOHNbPigKMhQPGheS25cQ= X-Google-Smtp-Source: ABdhPJzU3UAoD0WJvMp+K2qYhB0yg2tKyJ9ckY1EvAssc2eADYeaVrIG9XTSFQRrCp5PMKEA4wqmkQ== X-Received: by 2002:a5d:6944:: with SMTP id r4mr8758522wrw.151.1602920272036; Sat, 17 Oct 2020 00:37:52 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id 24sm5946553wmg.8.2020.10.17.00.37.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Oct 2020 00:37:51 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sat, 17 Oct 2020 09:37:38 +0200 Message-Id: <20201017073745.403153-1-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v3 1/8] avcodec/movtextenc: Fix potential use of uninitialized value 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" Background colour was never initialized if no style was available. Use a sane default of zero (i.e. completely transparent). Fixes Coverity issue #1461471. Signed-off-by: Andreas Rheinhardt --- No change for this patch since last time; I am just resending all because I have added a few patches that I intend to backport and that therefore should be applied before "Simplify writing to AVBPrint". libavcodec/movtextenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/movtextenc.c b/libavcodec/movtextenc.c index 5f60b8db61..11db240ab7 100644 --- a/libavcodec/movtextenc.c +++ b/libavcodec/movtextenc.c @@ -205,7 +205,7 @@ static int encode_sample_description(AVCodecContext *avctx) ASS *ass; ASSStyle *style; int i, j; - uint32_t tsmb_size, tsmb_type, back_color, style_color; + uint32_t tsmb_size, tsmb_type, back_color = 0, style_color; uint16_t style_start, style_end, fontID, count; int font_names_total_len = 0; MovTextContext *s = avctx->priv_data;