From patchwork Wed Jan 3 22:42:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 7107 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.79.195 with SMTP id r64csp16441769jad; Wed, 3 Jan 2018 14:42:53 -0800 (PST) X-Google-Smtp-Source: ACJfBottS4taYTLVdsLByuSwc6N1j3i0eXlZVQQCww8dWaqwkZyBDTBmdjQqVmptsWIZODw4F38K X-Received: by 10.223.173.173 with SMTP id w42mr2773113wrc.19.1515019373531; Wed, 03 Jan 2018 14:42:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515019373; cv=none; d=google.com; s=arc-20160816; b=SgfQf8B0yWwRa3WwedWg8z+PP1jSMb+a5nEYwzy7Zq6nssnOMyfvUca/ftDqfOGfEt qVV2PgRBF7HqYsWEX+9rKx04ZmqsNBU21hS9ngUDEverBUBaa6WtN/FS3typWPW9avQ3 UNPak1FtuWpJhzMaViAZR6Qh9paZF6W3oXsEsuEHWTv9Mg9rGn+kCctpyrOggKKDuuAV WeOUScQgUmYkMLtKLlqGgfjQDEscMDFcpiVNKc+vhHNtp4U320wLfinyjc+KU7Cu3Nd7 CHrIHlAWcbohvwJjsqiLHNKUZ821wNA1q49zxFee4/mVWPyaZ/rXaih6o+Q3smpgtJJX zaXw== 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:references:in-reply-to:message-id:date :to:from:delivered-to:arc-authentication-results; bh=pRROVvT5YTou0YgijMRR4fpVoqmbl9chikgSo+OoDvc=; b=YVINStxhY8Cc9nvn+AbugiSbretGEZXVkv6ey/Q2MAgd0TYaZv5x19WfB0o/K1/eJc P/OYodOlXR9Q/ubHEcir8z1WPw9cxTCVGDTfaqZy+uXyPLAxwMjsIeRi2FeLF4SQn8wb Z2qWvQfW9NRNLaymfAmBxInWGh8cEqL+CFXUYGz2bkGl+XlsEoCG5vQ19AnfLwTXv1tw 5TTE9X9+f32rVFI6sCZs5VvzrPhUPSj+DEkLkj1g+ubbkkgKCkrq8dQBlHpwkrwv6QFp u32GMNlpwfaBMvWG1CvLbiXZKiPPGj5EAhzeXzKFTA9DBIQA1aodv+zRv/bU1MazpJJe umJQ== 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 j20si1277606wmc.224.2018.01.03.14.42.53; Wed, 03 Jan 2018 14:42:53 -0800 (PST) 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 046B86883A5; Thu, 4 Jan 2018 00:41:57 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe01-3.mx.upcmail.net (vie01a-dmta-pe01-3.mx.upcmail.net [62.179.121.156]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3EC22680A1F for ; Thu, 4 Jan 2018 00:41:50 +0200 (EET) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe01.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1eWrjY-0001Sr-U7 for ffmpeg-devel@ffmpeg.org; Wed, 03 Jan 2018 23:42:04 +0100 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id tyi31w01M0S5wYM01yi4ts; Wed, 03 Jan 2018 23:42:04 +0100 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Wed, 3 Jan 2018 23:42:01 +0100 Message-Id: <20180103224201.18317-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180103224201.18317-1-michael@niedermayer.cc> References: <20180103224201.18317-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 2/2] avcodec/h264_slice: Do not attempt to render into frames already output 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: 4698/clusterfuzz-testcase-minimized-5096956322906112 This testcase does not reproduce the issue before 03b82b3ab9883cef017e513c7d0b3b986b3b3e7b Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/h264_slice.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c index aad5484588..e6b7998834 100644 --- a/libavcodec/h264_slice.c +++ b/libavcodec/h264_slice.c @@ -1571,6 +1571,12 @@ static int h264_field_start(H264Context *h, const H264SliceContext *sl, * one except for reference purposes. */ h->first_field = 1; h->cur_pic_ptr = NULL; + } else if (h->cur_pic_ptr->reference & DELAYED_PIC_REF) { + /* This frame was already output, we cannot draw into it + * anymore. + */ + h->first_field = 1; + h->cur_pic_ptr = NULL; } else { /* Second field in complementary pair */ h->first_field = 0;