From patchwork Fri Oct 16 03:17:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 22991 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 72D7D44B321 for ; Fri, 16 Oct 2020 06:18:12 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 47F4568B9EE; Fri, 16 Oct 2020 06:18:12 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DB0B468B84B for ; Fri, 16 Oct 2020 06:18:05 +0300 (EEST) Received: by mail-wm1-f66.google.com with SMTP id b127so1288786wmb.3 for ; Thu, 15 Oct 2020 20:18:05 -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=h+YK5+1c2VyEN0LDo/nJjbdqmhGw2oUjW+mjdmIUumM=; b=UCIpxrCsoSQW03vfYFLpkwG5SPigYG4AKkdVJ+y7ID/sdsGMRPYXNvFE03RKqY/zcs 3gDk82RY06iZhIC9/OMMNPtHUsbU3K4yHa2ELMgBmTytt5W2VrUsSxUMuB7Hdu5/IQMs PgeUF1386IKrH00LAmmnc/YGtE8qkipp7s3Zk0HGUXE3xF6vzDhsQw2sfGjKqWJD6txG 2Ip3alRzC31IIe0e8i7Q1MQto7PlUztBAmJFsr8WSDERfQD072JKvpF0ax1jmLzuwHXu H/LwDkbedojzpxk+pyF8oyupx6qIzFKAYRas3GK9MQghqnQ8q5WhuACXPkzb5+dS3TVf HKtg== 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=h+YK5+1c2VyEN0LDo/nJjbdqmhGw2oUjW+mjdmIUumM=; b=pghaWfx1xcemCxV8VMxBY1g6eqfANKuev/y7jPK7woklBwPriA0WTI7hqdlCzLAfBZ fP6MRavZ5y8qu/K6ieJXJNJOjPDdFUYK7GoGVxxBbOB7GqM+vH8rPFMCtmqcnHlpuf4r hCCd3dCM4RPeE7+diEV94idezVau8XAov7RB1vG3ehmvCi3kPndFGX+cxWVfTHxSLupE Yh5KVDZ2owhGYGI2hagiBreGlS8YyO58qci8V8WGqQbaQBf9FWNyUy57jY8NKQUXoC7d abeYkespTePxk25WcddLhB1U99dxfx7WdeW7+tqdF+ji2zW98wD/t5sfiBQRY++Ktr55 zezw== X-Gm-Message-State: AOAM533QbXHkGTUCtG4JCD+UKfSDs+QvcPsWI9ULAT9uIUSDZO338Mn2 78FC2h0IMwl2CdW44lJS+Tm/kHnhBjQ= X-Google-Smtp-Source: ABdhPJxRvzycMP5f4ghLG5i/QMv86Yt5l60OwGbtOzKmqaXwHMA1gTa8gfwwfRaUwOjW6H43LA6v8Q== X-Received: by 2002:a1c:8187:: with SMTP id c129mr1613217wmd.82.1602818284996; Thu, 15 Oct 2020 20:18:04 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc1aa4b.dynamic.kabel-deutschland.de. [188.193.170.75]) by smtp.gmail.com with ESMTPSA id y5sm1515830wrw.52.2020.10.15.20.18.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Oct 2020 20:18:04 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 16 Oct 2020 05:17:56 +0200 Message-Id: <20201016031758.214795-1-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 1/3] 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 --- Commit message updated to include Coverity issue. 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;