From patchwork Sun Sep 17 00:42:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 5168 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.36.26 with SMTP id f26csp2116341jaa; Sat, 16 Sep 2017 17:42:26 -0700 (PDT) X-Google-Smtp-Source: AOwi7QDYBY1MEcP02Xc/YOC/FptbXzy+9R8qIAgUDOkZcFVcaFmUFAGXIUfL4szfhgdl6KMJhJxg X-Received: by 10.28.105.92 with SMTP id e89mr5490197wmc.65.1505608946435; Sat, 16 Sep 2017 17:42:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505608946; cv=none; d=google.com; s=arc-20160816; b=lsek1IV2tF0dOUCxyhLBxK/JNaOfPJnVXZjpmA+dBji9jhcr+AlNhJOec+FMRVs2gX uPKA9yj73A/FHWyunxdrVX175Hhbpo5KI3sC72G56PcBJviJY8eYdiYJ3KqbqaYycSnw boZmVe93DRLE1LP7PaLn4TjvTizMs8mgUw7ufxCEVMzxtG8KhgwJ5gdmOhlRw2dKzHaa 4vLt4MelTYpLKvQio7DBCp6YUb4PxKFrkdOGMnI5U+iFONO/LJAmlMXGGHKS201HaRuM vq4tqorEC95xzvMewkvehDnrb5JYfxQMPPX+/4nUBqo/EfrcLnCzSm4aaqn36flMPGrJ x3jQ== 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=Cph2x7DGck0f1mEWp+8YtybgjokLEt6Qv1iX3GyEqpc=; b=o6Tz1JlE00cV6QuDvUlj8X21l8a5/kHAS8On7meyOUrv+fveroLEGQ+as4JhAUhZl/ OXx9R/R92wPl4zFuiKiPPo2BTG2y59/J7lI4SHIA2W8+aB4n2mG3SMnjgpwTtD3nmMwv hKDzHoVU0/4T9oNVHecH03hZWTog6uOZ0AdHZfP157LmULyU7WIFOp9B4BpeljhdUp0a ZXMoxB4G5QHcHdcZFwKNNr04pLlHYr6QJnziH2Rj23v8a7FST4eLacbYZDbKpye823sg L8VXZre99Zx3MWSjevQfzymrr/X4CRDXLXBbUtJV20SxH/7y676Ij0yKihErWR5zN+yF itag== 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 z189si3700140wmd.115.2017.09.16.17.42.25; Sat, 16 Sep 2017 17:42:26 -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 92503689828; Sun, 17 Sep 2017 03:42:16 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe04-3.mx.upcmail.net (vie01a-dmta-pe04-3.mx.upcmail.net [62.179.121.165]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 04986689755 for ; Sun, 17 Sep 2017 03:42:10 +0300 (EEST) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe04.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1dtNf8-0001So-BP for ffmpeg-devel@ffmpeg.org; Sun, 17 Sep 2017 02:42:18 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id AQiE1w00K0S5wYM01QiFQs; Sun, 17 Sep 2017 02:42:15 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 17 Sep 2017 02:42:11 +0200 Message-Id: <20170917004211.12545-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170917004211.12545-1-michael@niedermayer.cc> References: <20170917004211.12545-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 2/2] avcodec/pngdec: Clean up on av_frame_ref() failure 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: memleak Fixes: 3203/clusterfuzz-testcase-minimized-4514553595428864 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/pngdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index dce8faf168..0d6612ccca 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -1414,7 +1414,7 @@ static int decode_frame_png(AVCodecContext *avctx, } if ((ret = av_frame_ref(data, s->picture.f)) < 0) - return ret; + goto the_end; *got_frame = 1;