From patchwork Thu Aug 16 13:36:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 10009 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:104:0:0:0:0:0 with SMTP id c4-v6csp2044559jad; Thu, 16 Aug 2018 06:36:48 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxhPt74NckpzvcJbTHz1a+hOKrD04Rsk1F0EHe3SVPPtGpy974jaHETPuuJpR4NYGmaJSYG X-Received: by 2002:adf:e648:: with SMTP id b8-v6mr1832839wrn.254.1534426607983; Thu, 16 Aug 2018 06:36:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534426607; cv=none; d=google.com; s=arc-20160816; b=oLw5ublDn24YtoJBotFQV6o1Wl/PWWAQdFnlwtfzdnAK2Zx4UenbL9nDsi0jzhW7ic pWM1mcbgUjWSLxVU2QAekIlrjiRR7/XjaQ5OjYAeZus6C/t3eQhZschG6EwSLwxUwvvN E02hhKmO71WYqWrBOQO7RXHmTYg6tYY809J4x7fwGDGC/LbvYNVoEQeZuzJSGaBu2rR1 EWEdKMHxg8kdZXnZXM+ijb0yXMCEyHFHgOcWgSEgoGBPj+W7OVVXrmXx1u5OMjKzyruw K2v5iYQBmXYOEc+PK2JXkvPi7eeR4rC1Wd7JR3co0nmU2NKgy+4iLjHNtjnmQZZ074Cf U4Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:delivered-to :arc-authentication-results; bh=pfzPIVhurYt5hLmLn6HS2kXFVA4xXSKYK+5eVZdUaLA=; b=dt/eOeAY1t1urOVR6P1h+oI7kqineuoe5DzHbSctytlILHTNYzhZ1G0lg1RASq9c6Y cAFcZQSgYel3Z+5aLVV+DtSROAYvGAduiEoLBoxsTCKAChsQnWoPw+gNsL680k4Vd52r qJozUWy7rRrsezowljDMBoh/3xKIpIHBwBHHwRfMjQKbVWQ0h/ufSJmFLFm8ckOLH6Ra 33ZwH/XwfjkL79kAEi+VgYDCSorde+g9tZNkDVI/vPG3c2NNHxB0a1Iji2QVKL/9dMoC XVOnhYu6XznJ1eCm2aq5GWgoU5i9yXXB7JSIold3hXPtzh3IZbF7nWJaxb5gsksJca6M XYbA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id f187-v6si876904wma.118.2018.08.16.06.36.47; Thu, 16 Aug 2018 06:36:47 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 50C4B68A6E5; Thu, 16 Aug 2018 16:36:20 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-qmta-pe01-2.mx.upcmail.net (vie01a-qmta-pe01-2.mx.upcmail.net [62.179.121.179]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 204C768A5C0 for ; Thu, 16 Aug 2018 16:36:14 +0300 (EEST) Received: from [172.31.218.51] (helo=vie01a-dmta-pe07-3.mx.upcmail.net) by vie01a-pqmta-pe01.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1fqIS6-0000np-O4 for ffmpeg-devel@ffmpeg.org; Thu, 16 Aug 2018 15:36:38 +0200 Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe07.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1fqIS0-0007qq-Uk for ffmpeg-devel@ffmpeg.org; Thu, 16 Aug 2018 15:36:32 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id PpcX1y00x0S5wYM01pcYJG; Thu, 16 Aug 2018 15:36:32 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Thu, 16 Aug 2018 15:36:27 +0200 Message-Id: <20180816133629.9352-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.18.0 Subject: [FFmpeg-devel] [PATCH 1/3] avformat/mpegts: add missing null pointer checks in ff_parse_mpeg2_descriptor() 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Fixes: null pointer dereference Fixes: wtv-crash-75fa58662ded1c1d349f3d1df89394fd690cf92f Found-by: Paul Ch Signed-off-by: Michael Niedermayer --- libavformat/mpegts.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index a5cb17ac16..edf6b5701d 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -1983,7 +1983,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type int service_type = ((component_type & service_type_mask) >> 3); if (service_type == 0x02 /* 0b010 */) { st->disposition |= AV_DISPOSITION_DESCRIPTIONS; - av_log(ts->stream, AV_LOG_DEBUG, "New track disposition for id %u: %u\n", st->id, st->disposition); + av_log(ts ? ts->stream : fc, AV_LOG_DEBUG, "New track disposition for id %u: %u\n", st->id, st->disposition); } } } @@ -1997,7 +1997,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type int service_type = ((component_type & service_type_mask) >> 3); if (service_type == 0x02 /* 0b010 */) { st->disposition |= AV_DISPOSITION_DESCRIPTIONS; - av_log(ts->stream, AV_LOG_DEBUG, "New track disposition for id %u: %u\n", st->id, st->disposition); + av_log(ts ? ts->stream : fc, AV_LOG_DEBUG, "New track disposition for id %u: %u\n", st->id, st->disposition); } } }