From patchwork Wed Aug 23 20:50:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 4812 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.15.201 with SMTP id 70csp44095jao; Wed, 23 Aug 2017 13:51:02 -0700 (PDT) X-Received: by 10.28.179.85 with SMTP id c82mr2708739wmf.189.1503521462103; Wed, 23 Aug 2017 13:51:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503521462; cv=none; d=google.com; s=arc-20160816; b=EXSzpFEXQf3/+R3WBTLhbVc8Og6qTCmtkk5WHhSbIS1ijPbo15hxyE+yL66++fZaBz hDXZ/yDrj4Kw2B4y8bUFbFLUgDh8BpuMGHOVEyV4VhQaCOAuowP7GIscNhI04bCubzhv oVmuefygeOmDLDKICPBtYuQAV8gFOet4/bB4M8FFiKiUfw8jXs5/ff88wwlmwxjVxE0z OT83JL/MUc+xZ27OJiEW63+Hu05pUe1l3mtu4kEwiagA80r6aXaoyQZznKoUn6Yec7Hr y4EUqmZcYQPNq71Oxp7dDZLHLPYt3VKsEDWpHKrzNpI948JljQzyXwYds+v/rynFk1H5 ul9w== 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=UNVmhoDcyvM4RgOCDqqHjQTC/xFhUKK/j5c9fBootlE=; b=b4DDb6Myb+yup1CxJE05QowNBMIvJ8g3FOQWjc+rwP5//tNsaxFXTdH8koT1+sV2co 23s4ZNiBauJvUyZ7y7l6FXbkgpv///657+89ixfOUSoaQUGTcQIUYjSS9Idgi0MbXHgP uAgNsuYAWZbm5dNQSAR5FBz1s/NpaRUcEXCWSeyEJIduzJG4Jxw2Oa3gquxbjrAoI+4Y kz0i5AZXZSBHAvROYr5aNuYVta5VQr/EAWFAR3OmguAQgD0+XjhB9JVIWA400wH2C8pu z6+DfHxotPJ/UF08sMBLagAzpdpXngh2W+CmUa91Fx9/H+DlQnEFFDKD6SQPNphsYx7E L1TA== 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 j2si1879376wrj.325.2017.08.23.13.51.01; Wed, 23 Aug 2017 13:51:02 -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 130616882B7; Wed, 23 Aug 2017 23:50:51 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe05-1.mx.upcmail.net (vie01a-dmta-pe07-1.mx.upcmail.net [84.116.36.17]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C7DB768826B for ; Wed, 23 Aug 2017 23:50:44 +0300 (EEST) 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 1dkcc0-0000Ab-8I for ffmpeg-devel@ffmpeg.org; Wed, 23 Aug 2017 22:50:52 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id 0kqj1w0040S5wYM01kqkFl; Wed, 23 Aug 2017 22:50:44 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Wed, 23 Aug 2017 22:50:42 +0200 Message-Id: <20170823205042.25170-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.14.1 Subject: [FFmpeg-devel] [PATCH] avformat/rtpdec_h264: Fix heap-buffer-overflow 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: rtp_sdp/poc.sdp Found-by: Bingchang Signed-off-by: Michael Niedermayer --- libavformat/rtpdec_h264.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/rtpdec_h264.c b/libavformat/rtpdec_h264.c index 8dd56a549e..6f8148ab6d 100644 --- a/libavformat/rtpdec_h264.c +++ b/libavformat/rtpdec_h264.c @@ -166,7 +166,7 @@ static int sdp_parse_fmtp_config_h264(AVFormatContext *s, parse_profile_level_id(s, h264_data, value); } else if (!strcmp(attr, "sprop-parameter-sets")) { int ret; - if (value[strlen(value) - 1] == ',') { + if (*value == 0 || value[strlen(value) - 1] == ',') { av_log(s, AV_LOG_WARNING, "Missing PPS in sprop-parameter-sets, ignoring\n"); return 0; }