From patchwork Tue Oct 22 13:16:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 15898 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 47464448AC9 for ; Tue, 22 Oct 2019 16:17:00 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1D98568AED5; Tue, 22 Oct 2019 16:17:00 +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 4677268AE8F for ; Tue, 22 Oct 2019 16:16:54 +0300 (EEST) Received: by mail-wr1-f67.google.com with SMTP id n15so7239648wrw.13 for ; Tue, 22 Oct 2019 06:16:54 -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=ryyOtaVkSyvnsH3t7AvnSsPhl2ovCrE5w4ZpSGjLLv8=; b=jKxlTElQiIdkBSSdCUQ45ePBRYmkWUkqqanPpZ6rRogCb0hO6CwJMpxb0AAJiDR1RI Cw36k+3MaGjnnoSZwVcUhHVMHmQobclG2DgO/FWIftHntAGQcDVv78O5CBUFyfrEhnjZ /BtPsoN6TWczu/tK+aTFQ5Dy2D4A/K0GQvIu1uBZ4BEPfQmzcq1m+VLxParXijZoUrbI BpuWMTEYajgbI5+ChZWZjNKjoaF61oEBfnRYf+vwbLrpExZYd/+kZLUVx+Uq9QAUZ5ND 5SJDkMBczZlDTz9lK514hTjcg8bWQrCTNaD1LUP3PZ91kmGyP1CNjmsuY44z0NhJsDTT jftQ== 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=ryyOtaVkSyvnsH3t7AvnSsPhl2ovCrE5w4ZpSGjLLv8=; b=r6xl3HyampV/8CWfuz4mbf7LL+qjNRFiy5cJJJM2yKTnJni3Cd4DIKSVKEhNu2CCwZ qkqit9Q4Qn2fq2Q/FV03++nRecZL6DC3jXyWtye1nkcmhfkf9qhvj6Sdi3wKmCqsw5l1 ipWjJsty2x7kQER0fdxKX8XF0ppbJj4we8gNmQJibIQCLJhzTXrPgzl2bhBWpyoOtORF 361+11UGRDX3OhTsI7xknz7MqOfc16J8NzcPFHM4vEynJV0qITSSHV9yVKGaeJ+Uhvvr EkK4WAuxjeO0kdvgbFdVVvJj7jEoYLMDHv+Y58p1e3LqqQPwHBrwXM5g9uK+XS5BYPWk elNQ== X-Gm-Message-State: APjAAAWsKT8H1lAFVGgDqlYKgP6ndzfrxZw9iKgSdRIpFVRMnibjSu8S Xl+kV4gPQijvnP1RKaOvI1VJEOoW X-Google-Smtp-Source: APXvYqw7PhGyruhE8N3MPCXTJzPYHwnsHEVv/RoxOcJz0/7qon6wrXYQKrMnVXsV3u9cUzXcnNECtg== X-Received: by 2002:a05:6000:44:: with SMTP id k4mr3604249wrx.170.1571750213525; Tue, 22 Oct 2019 06:16:53 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc08937.dynamic.kabel-deutschland.de. [188.192.137.55]) by smtp.gmail.com with ESMTPSA id o70sm25074520wme.29.2019.10.22.06.16.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Oct 2019 06:16:52 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 22 Oct 2019 15:16:41 +0200 Message-Id: <20191022131645.8394-1-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/5] avformat/mpeg: Don't free unintialized pointer 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" In order to fix a potential memleak upon failure, 0b8956b2 made sure that a buffer given by a pointer was freed upon error. But this pointer was only initialized upon use and in several cases (Clang gives no fewer than 13 -Wsometimes-uninitialized warnings) this meant that an uninitialized pointer was used to free a buffer. So initialize the pointer. Signed-off-by: Andreas Rheinhardt --- Was 0b8956b2 ever sent to the ML before it got pushed? I couldn't find it. And what does CID mean? libavformat/mpeg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c index c33401f1a0..ebc064931a 100644 --- a/libavformat/mpeg.c +++ b/libavformat/mpeg.c @@ -720,7 +720,7 @@ static int vobsub_read_header(AVFormatContext *s) int i, ret = 0, header_parsed = 0, langidx = 0; MpegDemuxContext *vobsub = s->priv_data; size_t fname_len; - char *header_str; + char *header_str = NULL; AVBPrint header; int64_t delay = 0; AVStream *st = NULL;