From patchwork Thu Oct 24 01:36:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Wang X-Patchwork-Id: 15933 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 420B44497FB for ; Thu, 24 Oct 2019 04:36:45 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1409068B130; Thu, 24 Oct 2019 04:36:45 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf1-f195.google.com (mail-pf1-f195.google.com [209.85.210.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 9E7E668AF63 for ; Thu, 24 Oct 2019 04:36:37 +0300 (EEST) Received: by mail-pf1-f195.google.com with SMTP id c184so4525893pfb.0 for ; Wed, 23 Oct 2019 18:36:37 -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; bh=LlG4n08igMAQsckYmgp9Qiuvu/D9IJvNw3/ui3O/Bq0=; b=Ny9r0/1EUQU9elBxEJ7eCpkCEsZLBZ5YG/PhYe3EOdjtJCZSjgfQHyyug9KA+8ooug McA4yzNH6hMVCi2m9UwBLRznWpgLHpxrmxrCr971BcJe2pV2V39joWQTjINa7wAoGrTA 85lRTCWQSaJLCoxmqecbaQZVSaBZUeD/kfghck80RYJpC9epy9jvEwC/ewICcON2g3ga P0cLZNYFUofBELwSpgI5EfvN3tI3i7+11509lnMOJSJVxlOTcr7xrOyPEO7Iw4ipx3vS +WAuvLyoZvEowmPqMFF50BER3ySKCWnlkQsbhqQtgxRVXWoN0uw19EO2B/MnAV6MCecb I1ZQ== 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; bh=LlG4n08igMAQsckYmgp9Qiuvu/D9IJvNw3/ui3O/Bq0=; b=ExPjTWFtTjOw/P1BO8mcKU5MBP5bsoWGyVYJe/GOIpD1vuTeyVLOOJYeZWQM8FzOmz aGmOiMkXp8/Mjd2N5xuqCCRjL7B/JHpRhZjbWBB/MOQ4ZJaf4ff5s5R/1AJThz4aG/e2 rxH92YXzO8xUBePe85SniCK6J0Er9OfWhslMYpCdXQIE25SQi6UUeL2/YAKhUdi6WUQb BclTkjzBZI0TWT8l3S663ccxqrH8M5DcsIa9Or7D2HKIKCKYyDzQh6ZdyydfuG82CqVG DvsANQSPtywTkz1O8rV/OiGPidPQdUDP8rAdjRUf3HzkH63GI2oeeKndhYDasRSXdFLp Pa3w== X-Gm-Message-State: APjAAAUpYjIo9vALKdvplKlVF57ds3SkqjbzkeXhobQtjmjDyKEsN25o ZEakp0nuN0IDQygEd2No4M7OcK2mWUI= X-Google-Smtp-Source: APXvYqxDFMFUljQkfAlVQKzk7MOGCBgu7LYXrdmuekQwMJhJGTemjK/wymbrFBV9YOWfqUsWxM/oiw== X-Received: by 2002:a62:5209:: with SMTP id g9mr14588216pfb.28.1571880995739; Wed, 23 Oct 2019 18:36:35 -0700 (PDT) Received: from vpn.localdomain ([47.90.99.151]) by smtp.gmail.com with ESMTPSA id 18sm27800181pfp.100.2019.10.23.18.36.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Oct 2019 18:36:35 -0700 (PDT) From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Thu, 24 Oct 2019 09:36:31 +0800 Message-Id: <20191024013631.1396-1-lance.lmwang@gmail.com> X-Mailer: git-send-email 2.9.5 Subject: [FFmpeg-devel] [PATCH v1] avformat/mpeg: fix CID 1455132: Memory - illegal accesses (UNINIT) 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: Limin Wang MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Limin Wang Before header_str is initialized, the code is possible to goto end and free the header_str and cause invalid access. Signed-off-by: Limin Wang --- 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;