From patchwork Thu Jun 4 20:03:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Foucu X-Patchwork-Id: 20151 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 9E18E449AEE for ; Thu, 4 Jun 2020 23:03:13 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 73FF268AFB1; Thu, 4 Jun 2020 23:03:13 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 914F768AA92 for ; Thu, 4 Jun 2020 23:03:05 +0300 (EEST) Received: by mail-pg1-f193.google.com with SMTP id p21so3967286pgm.13 for ; Thu, 04 Jun 2020 13:03:05 -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:mime-version :content-transfer-encoding; bh=RvQrUFGsdX2fS66mlRYaRaPtpw82uj9WsjBZ0VoC6+8=; b=EiB24OPivp1f9Ph72MEvpKaDAHcu71nvb5MvG2upQeeRHq8Oz7jPv8IJbPB3wldHIK UTFwQSfSS4d3LSe12Zlpl6o/IaWUsTMMYwegzHfXcZnxgGkpvwHttVmRi9U4YcLjEu/K zk0HPRS2H9B53WIu+p15316tLUIuF4jjK6JtkPfdfwcFuIscI6OcQEF9Vp6sVQmgeQmg sHW4kNEH1JqaKDQ7IKZ4S//IHw0hE3KBmQO6QBz2Zp1C0eJZz43NbZ8duCQSD0dm7CSw pXXUjy4ZjmJyibUgumkN4op4fzyI6ITw96JG5Cz7vURSMkJd65R8qqAt+eu7q6RpkEo3 /ODg== 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:mime-version :content-transfer-encoding; bh=RvQrUFGsdX2fS66mlRYaRaPtpw82uj9WsjBZ0VoC6+8=; b=DxPhDV3z18bKioeI2AdrxnNq0G6A1eThUub6vM7h2f2Yj/7NVckAlJbtgpr4f2Nhew jn6IVmYr+so1FKnqkvMnywY0Wp5U6jLmNLcyEbcO1u8qycU220EE4hxTdEy8ocngCbYv l7/q2UNj974Dn+oYoyhm/+4NtF1qV0J7hks8h1y4G9vXHp51sB0/xEOahUB6ddcrFE7s NasEu52IGSiufTvhCARmhx4KjXNdPjvV3qpCzLka9bc2zyVNAT5W9bEzkAeookbOIPVh 0uOQnKcALCmtQ7gPCVql+wfaErgk/BnZP8QGJ/+LGACCnTNKR11KEs9s+YTPErKbLSer pPzw== X-Gm-Message-State: AOAM530k3RzDTM/X+VphbM4+rKmxU0sLsuGohSTwNQpdvDCcLaxfHX+X lI/FVrNdVwptSQasJHYUNg6LeT1D X-Google-Smtp-Source: ABdhPJysgVNRphwSyKPNJECANz5DlxRwEujYnohkW8/ZYywHPFB05bOXxVDbaWz7uNrA6ig61n+PJQ== X-Received: by 2002:a65:6694:: with SMTP id b20mr5933693pgw.303.1591300983404; Thu, 04 Jun 2020 13:03:03 -0700 (PDT) Received: from tfoucu.mtv.corp.google.com ([2620:0:1000:4001:8e18:4d51:fb1:d54f]) by smtp.gmail.com with ESMTPSA id 207sm5057011pfw.190.2020.06.04.13.03.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jun 2020 13:03:02 -0700 (PDT) From: Thierry Foucu To: ffmpeg-devel@ffmpeg.org Date: Thu, 4 Jun 2020 13:03:00 -0700 Message-Id: <20200604200300.156597-1-tfoucu@gmail.com> X-Mailer: git-send-email 2.27.0.278.ge193c7cf3a9-goog MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/3] libavcodec/png_parser.c: fix a use_of_uninitialized_value in target_dec_fuzzer. 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: Thierry Foucu Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" the target_dec_fuzzer is checking for the avpkt.data pointer but if the png parser cannot combine the frame, the poutbuf is not set. --- libavcodec/png_parser.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/png_parser.c b/libavcodec/png_parser.c index 74f2964118..9ec8551a1b 100644 --- a/libavcodec/png_parser.c +++ b/libavcodec/png_parser.c @@ -45,6 +45,7 @@ static int png_parse(AVCodecParserContext *s, AVCodecContext *avctx, s->pict_type = AV_PICTURE_TYPE_NONE; *poutbuf_size = 0; + *poutbuf = NULL; if (!ppc->pc.frame_start_found) { uint64_t state64 = ppc->pc.state64; From patchwork Thu Jun 4 20:03:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Foucu X-Patchwork-Id: 20152 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 58E4744AACD for ; Thu, 4 Jun 2020 23:10:05 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 334D568AFEB; Thu, 4 Jun 2020 23:10:05 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-il1-f196.google.com (mail-il1-f196.google.com [209.85.166.196]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 43B5668A452 for ; Thu, 4 Jun 2020 23:09:58 +0300 (EEST) Received: by mail-il1-f196.google.com with SMTP id p5so7356462ile.6 for ; Thu, 04 Jun 2020 13:09:58 -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:mime-version :content-transfer-encoding; bh=LRna/H80I+WRninX4255ZrjVchYFGmoxrcewFKJyTlc=; b=X2ZeHo0DqwKnfNYYFHyR3xe7VWqdpO6HVsOCT4KynuE0GMaHxRlMRacl5H6zgz818b XjIEF0nD/Zt9JDwFx0HAhIat9dftvmwJF859wC2yocQcDDE00UUFpatoCLtkn0k2mx4g dbSVbbX1v6YVMaRMciFELUk8AnNEfC8Dex4zl8+GYBklVtHNPO4vbCfUznI/Fh/cvHbb QG0zEN9PgIO2ESqxuucVHGaEApqrSqPbdO4gwDcgRkKyxmcei1ifGbL+MMO4Lss8ljsY 9/h6/pJR9VhLkBbUD2fs/pa46tmEK7fVZEHK7IAqejwA9dKyMyW9TIk34wg6TmYb5YU7 v/mg== 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:mime-version :content-transfer-encoding; bh=LRna/H80I+WRninX4255ZrjVchYFGmoxrcewFKJyTlc=; b=oYXooIvO8pMgK3FQoNB1HbN12lbHSwDum3QpsslNKHa7JXsjykM/jaCU+WkS/+d0FQ f57GMGcxlXW+m4J7nk+5g7FoqOVPwjhw+92AiZ+SER9mxwAFIBi0YetvXyK7pRz+AYmI LRkVpMFbws7ldq8sehI62hL4NoXa5XNOXeBPyWoA9P1JOMOUZ7U42iThyEpU6NNczAR+ 94CmeN2H1GINZO1/k7AhjBAmf6TQ9QeYs5pWUPMmTBSyn/KmSWNP0aQ3rzB6/iqwp6uA ShBIT4Bd/zvC1wVy4eV4PBn0s+yGT5SgicXetaF6O+2OmeHTolTrZO9nxb+NJp9Z6pmF ox+g== X-Gm-Message-State: AOAM530ixxhmdl8DufYxUqhe/pNIkQF7lJMQSdOBh3J+cUGboxzhmciU VF0h5kKUGMy/SRJSvDRB9DhRyKyP X-Google-Smtp-Source: ABdhPJxxCjYTbc2GYHllxh2UAEO7UiCB31HaR26zdT14yi3HzjuCwPIkWZfgxzR9F8uSE8dLEFnAcA== X-Received: by 2002:a63:f202:: with SMTP id v2mr5858797pgh.17.1591300998900; Thu, 04 Jun 2020 13:03:18 -0700 (PDT) Received: from tfoucu.mtv.corp.google.com ([2620:0:1000:4001:8e18:4d51:fb1:d54f]) by smtp.gmail.com with ESMTPSA id y136sm5429783pfg.55.2020.06.04.13.03.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jun 2020 13:03:18 -0700 (PDT) From: Thierry Foucu To: ffmpeg-devel@ffmpeg.org Date: Thu, 4 Jun 2020 13:03:15 -0700 Message-Id: <20200604200315.157718-1-tfoucu@gmail.com> X-Mailer: git-send-email 2.27.0.278.ge193c7cf3a9-goog MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/3] libavcodec/mlp_parser.c: fix a use_of_uninitialized_value in target_dec_fuzzer. 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: Thierry Foucu Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" the target_dec_fuzzer is checking for the avpkt.data pointer but if the mlp parser cannot combine the frame, the poutbuf is not set. --- libavcodec/mlp_parser.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/mlp_parser.c b/libavcodec/mlp_parser.c index 5d2ddc5a70..e7162f4aa8 100644 --- a/libavcodec/mlp_parser.c +++ b/libavcodec/mlp_parser.c @@ -64,6 +64,7 @@ static int mlp_parse(AVCodecParserContext *s, s->key_frame = 0; *poutbuf_size = 0; + *poutbuf = NULL; if (buf_size == 0) return 0; From patchwork Thu Jun 4 20:03:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Foucu X-Patchwork-Id: 20153 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 87AB444A915 for ; Thu, 4 Jun 2020 23:32:34 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6340968B01D; Thu, 4 Jun 2020 23:32:34 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-oi1-f193.google.com (mail-oi1-f193.google.com [209.85.167.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id F010568ABAB for ; Thu, 4 Jun 2020 23:32:27 +0300 (EEST) Received: by mail-oi1-f193.google.com with SMTP id c194so6284829oig.5 for ; Thu, 04 Jun 2020 13:32:27 -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:mime-version :content-transfer-encoding; bh=mmNml9aVXVE/hHzeEfUwNxd/gjW7K17iggH6Zdtud1o=; b=J5HFryl7+vmqHAqJ54/h+RcF7VPpK8+q20E5rNoCs/Spgv1b1yV/QOBC9CyWM5/I7a bX2gJDOYvMGDwfOQOAZN7OjKYHWNf1YrCRDCwh1XlJYRHtv3AjhBEKi5N6EBtb45M+AI ujcFqLYKvpenXkVXIJs9YMOEIU2UGRntQ6cgwP9QxzakTMzJ3RYYh7S7x5qUKLDcocPF ab4/IQpPyrxh4oS0brzCWalOoBCoEAztm7xJ8+lOO336qJDpR1KGO/37AlIg0jObw1VL UWgds3ChhOqOprCJzLJW9RBoZnRbI9o0E5GaUz32vbOUNfM71t7DIEe3NfrSjQ9Ercbu jDGA== 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:mime-version :content-transfer-encoding; bh=mmNml9aVXVE/hHzeEfUwNxd/gjW7K17iggH6Zdtud1o=; b=URW1Upn+tQI+DE0nuCU3W13ByISkIa1WZH0dD1geywiT5bxJh6YdHJDSfJRX5ZUxMd sSoTElAQmVYMpFIgQRwrFGH86dVEfelKCK3PSQlgoEii6iyiu48XOyeZHLlxYb9AlFz0 L4jdTofl6jvRYErO+RWFan2u4V8UoKt0bpOaxMlyy1MZlIaLLvLjtbIPiI/tuxDEEF98 VmFSb+CpstHPV4fntrDj7R0OaJpftTq+TuRZMNBDMW8H6doE69sR8XJzk2mZR6GnX2ZG 8rNhGvOP+P5obxCdppgQxhPCzNG+x1Jp3HO9YIxAdMy/XMKWeKPGlqukWtNvV/021xKs eiVQ== X-Gm-Message-State: AOAM532nt9PUdMxKrIVjKwlxfqn6KY8Nto20u+fVa8pUapjgS+9Fd4M2 FeapKv4adH3vdyvdj5E/Ci/nObKW X-Google-Smtp-Source: ABdhPJyViXGd5FrcrjaKwTXnuTl+h+l7yPCwdv0qzUkg3vQTPKsEfqcqg20y01LK1CLPERP8ysQd0g== X-Received: by 2002:a17:90a:e60d:: with SMTP id j13mr8046266pjy.127.1591301009782; Thu, 04 Jun 2020 13:03:29 -0700 (PDT) Received: from tfoucu.mtv.corp.google.com ([2620:0:1000:4001:8e18:4d51:fb1:d54f]) by smtp.gmail.com with ESMTPSA id g6sm5209081pfb.164.2020.06.04.13.03.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jun 2020 13:03:29 -0700 (PDT) From: Thierry Foucu To: ffmpeg-devel@ffmpeg.org Date: Thu, 4 Jun 2020 13:03:27 -0700 Message-Id: <20200604200327.157832-1-tfoucu@gmail.com> X-Mailer: git-send-email 2.27.0.278.ge193c7cf3a9-goog MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/3] libavcodec/bmp_parser.c: fix a use_of_uninitialized_value in target_dec_fuzzer. 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: Thierry Foucu Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" the target_dec_fuzzer is checking for the avpkt.data pointer but if the bmp parser cannot combine the frame, the poutbuf is not set. --- libavcodec/bmp_parser.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/bmp_parser.c b/libavcodec/bmp_parser.c index cd65f02a2e..700bf27af1 100644 --- a/libavcodec/bmp_parser.c +++ b/libavcodec/bmp_parser.c @@ -45,6 +45,7 @@ static int bmp_parse(AVCodecParserContext *s, AVCodecContext *avctx, int i = 0; *poutbuf_size = 0; + *poutbuf = NULL; restart: if (bpc->pc.frame_start_found <= 2+4+4) {