From patchwork Mon Mar 21 20:19:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 34879 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6838:ed11:0:0:0:0 with SMTP id hi17csp1960090nkc; Mon, 21 Mar 2022 13:20:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzT8ULHnXHWkGT033cILMdRLw/mK36jsdT2biSL0ZWGN9as8IhZVqWZ4bQBzV6YFLG8frac X-Received: by 2002:a17:907:c05:b0:6db:f118:8834 with SMTP id ga5-20020a1709070c0500b006dbf1188834mr23006951ejc.536.1647894014032; Mon, 21 Mar 2022 13:20:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647894014; cv=none; d=google.com; s=arc-20160816; b=D7GExWgSumt2/fN1pKGn4/zBWkD1V8wbMgaZIFFo84D9VnF4xFlKugcrEOgFXbqpHU BvUXMvnByC0mQEWfMr/+GxNyCc87kmwwsUhPGKL0HZLdw+NBzpAGFEMyAEyx63/YrqHb VDCFJXn6T9CtVVhXhe66pYahUi1hV8e6IxdzbeX2eWi3OMxTwiGHHTTMCKw5emNyOWsY 6xoNgZVLAeXe3FH1Jt2ZIEGj+GN1NZrPSgwRasdyW3VJ90uRI5kcogrzV3juhlf2KRN7 QoKNF/qssajmxm1C7odPQ0Iq0yyvVGoRR/PE+mkt2vPCU1eeU8ZlTH9a80V8f2t2aAT8 D6mA== 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; bh=epM7j4JsJMhkVqQ4zBOfMMqbJOcZDEt91skNQ1owmgQ=; b=iAkIN8VhoOrnuFSlmiArGQC+HZ0acDJ46LhYde6M4sU7qOC3GLcbsvW4ucwchAU+H9 xaUawgZCBz8M8cSA+CWFtywSA7ltVS6p8SKtBZJHyyZULfAg19k4WEIQYrbSpUVeGTNH 54AirXkdbepE+zoAxxEottz5SoXCE9ll0GKLfJhJPxA9UpneWRwXjqQMTo4zF3PBAXBZ d7uP5kgvXQwkTzQyVnnN/KpGZHaWx0/+4/IPThUhxjb5mO9ABU8f6PjgWrCwXllaty/P jMLxj6wCo8KWAW+YFgrSQMkIJpM3tku1nILOORYF/Pl4r2o4PToZ+Gl3Cj631cnn5jfH CLxQ== 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 j9-20020a508a89000000b00418c2b5bdadsi10786974edj.143.2022.03.21.13.20.13; Mon, 21 Mar 2022 13:20:14 -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 35ED468B03F; Mon, 21 Mar 2022 22:20:09 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-at03-3.mx.upcmail.net (vie01a-dmta-at03-3.mx.upcmail.net [62.179.121.153]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AFD4B689A52 for ; Mon, 21 Mar 2022 22:20:02 +0200 (EET) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-at03.mx.upcmail.net with esmtp (Exim 4.92) (envelope-from ) id 1nWOVW-0002v1-8a for ffmpeg-devel@ffmpeg.org; Mon, 21 Mar 2022 21:20:02 +0100 Received: from ren-mail-psmtp-mg02. ([80.109.253.241]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id WOQgncbCqSgGFWOVWnNAT6; Mon, 21 Mar 2022 21:20:02 +0100 Received: from localhost ([213.47.68.29]) by ren-mail-psmtp-mg02. with ESMTP id WOVHnj3R98eSWWOVHnxfxb; Mon, 21 Mar 2022 21:19:47 +0100 X-Env-Mailfrom: michael@niedermayer.cc X-Env-Rcptto: ffmpeg-devel@ffmpeg.org X-SourceIP: 213.47.68.29 X-CNFS-Analysis: v=2.4 cv=KKE5sHJo c=1 sm=1 tr=0 ts=6238ddf1 a=2hcxjKEKjp0CzLx6oWAm4g==:117 a=2hcxjKEKjp0CzLx6oWAm4g==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=ZZnuYtJkoWoA:10 a=NEAV23lmAAAA:8 a=6QRxg8biEYerliJsndkA:9 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 21 Mar 2022 21:19:42 +0100 Message-Id: <20220321201946.16919-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 X-CMAE-Envelope: MS4wfH1hqgsrl+FWtizKGaV0K6EiGgr3pNmOG3fN0qHQq5uM3t+WDLHi1NaJIh3YRMO/gZ08zcXxdd+M9odhsO7UXHTG7OJUy/g45vkYjqpGKWVSQpJiUbts G3sMxKu0hv7gmCkviU3fVUJ4YDX/PlKQUSvRy9rsYuTxMw5prb4is/EcAhZHGAhrIkpoj3vBH9FZfQ== Subject: [FFmpeg-devel] [PATCH 1/5] avcodec/vp9_superframe_bsf: Check in size X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: 74L5vAgj4tGk Fixes: Out of array read Fixes: 45722/clusterfuzz-testcase-minimized-ffmpeg_BSF_VP9_SUPERFRAME_fuzzer-5173378975137792 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/vp9_superframe_bsf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/vp9_superframe_bsf.c b/libavcodec/vp9_superframe_bsf.c index 57681e29e4..bed9fd4ba2 100644 --- a/libavcodec/vp9_superframe_bsf.c +++ b/libavcodec/vp9_superframe_bsf.c @@ -108,7 +108,7 @@ static int vp9_superframe_filter(AVBSFContext *ctx, AVPacket *pkt) if (res < 0) return res; - marker = pkt->data[pkt->size - 1]; + marker = pkt->size ? pkt->data[pkt->size - 1] : 0; if ((marker & 0xe0) == 0xc0) { int nbytes = 1 + ((marker >> 3) & 0x3); int n_frames = 1 + (marker & 0x7), idx_sz = 2 + n_frames * nbytes; From patchwork Mon Mar 21 20:19:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 34880 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6838:ed11:0:0:0:0 with SMTP id hi17csp1960186nkc; Mon, 21 Mar 2022 13:20:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+flxOGda4YsIZ2KeKw+E6Yq9lTw0A29Sq+m8jthL1fdlYxXjgDMExRszYoXUsUrTRTOv9 X-Received: by 2002:a05:6402:17dc:b0:418:efa5:f445 with SMTP id s28-20020a05640217dc00b00418efa5f445mr24768547edy.125.1647894025034; Mon, 21 Mar 2022 13:20:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647894025; cv=none; d=google.com; s=arc-20160816; b=XR5b0agwGtpGLYYB/3ebSmqUhOxuCeb3lu1g7yG5EUL3zWv2LJ5nK/1awHU5M9xPZV GTKP/BytxKOGQ3KTwezYs513vcnbDvwDdx6Sx8PEuj9yVGAaKXjuTWBVmwIZ9aJWX5N5 EM2Fet1/0mNqj52+6ylZG6c7Q5tFuLQjx0qg9u65K6QPH4ql8ChNBOg5qm5/4DL6f09C UJYevP7zFyAgjfd+k0AtARNb5BtXwf9wNmJJU1fJu5Pv7UZr3mUoLbFbKI5X9mnxHAqe TLQzHV8L0Ei+NRsDAczKA3uUjgdekLWoVIxo/UYH9fD718uZKK2F/CvN4zDkiIQzMBwT 8l6w== 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; bh=QiXR9vQeaPD8FFyeltWqs/1TmP7iUWNvRkEcrkt8XPM=; b=orIBDtGYRxzTClVl3cijIjhSpn4J8Soe0oPeqHcD/BmbKjC0h05vDFdFXaI80QcDfm VJLIXHIPA3IibXyRkr/KdGuj34l+qN3uEdATYjjpLBqWccPajEy+7XoWtVr+45fms37T gcNMZXTufhmau1ZecK7NDHGYZ7Jhk/LjlCeym3ZdXqG//lkNzhvGx1j03A+B054aTnsS YCgiuOod8x7E/O/trN7Q1q24cpAS7yxwtwn1MbiE0VtbT3Aij/StH0VivtbgQ8sMj0IV wQDqpZPCrD9g2ttEBJLXGrK6KKjVSt7OFeQTHXRg9MCU7pdrJ872am1F+zI/YLnXVHLz +6jw== 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 z16-20020a5096d0000000b00418c2b5be5bsi9859915eda.317.2022.03.21.13.20.24; Mon, 21 Mar 2022 13:20:25 -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 4140D68B10B; Mon, 21 Mar 2022 22:20:11 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-at01-3.mx.upcmail.net (vie01a-dmta-at01-3.mx.upcmail.net [62.179.121.147]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 42993689A52 for ; Mon, 21 Mar 2022 22:20:04 +0200 (EET) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-at01.mx.upcmail.net with esmtp (Exim 4.92) (envelope-from ) id 1nWOVX-00Ghof-1S for ffmpeg-devel@ffmpeg.org; Mon, 21 Mar 2022 21:20:03 +0100 Received: from ren-mail-psmtp-mg02. ([80.109.253.241]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id WOQ6ncaEHSgGFWOVXnNATX; Mon, 21 Mar 2022 21:20:03 +0100 Received: from localhost ([213.47.68.29]) by ren-mail-psmtp-mg02. with ESMTP id WOVHnj3RT8eSWWOVHnxfxe; Mon, 21 Mar 2022 21:19:47 +0100 X-Env-Mailfrom: michael@niedermayer.cc X-Env-Rcptto: ffmpeg-devel@ffmpeg.org X-SourceIP: 213.47.68.29 X-CNFS-Analysis: v=2.4 cv=KKE5sHJo c=1 sm=1 tr=0 ts=6238ddf2 a=2hcxjKEKjp0CzLx6oWAm4g==:117 a=2hcxjKEKjp0CzLx6oWAm4g==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=ZZnuYtJkoWoA:10 a=NEAV23lmAAAA:8 a=HOdrBnsEXgKSFJCnHRwA:9 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 21 Mar 2022 21:19:43 +0100 Message-Id: <20220321201946.16919-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220321201946.16919-1-michael@niedermayer.cc> References: <20220321201946.16919-1-michael@niedermayer.cc> X-CMAE-Envelope: MS4wfCF7ZIuDnYhNjfe8+kUVouNuhGfFHYi4yhfjRwYCTiIcpNdzsbSfpV6k7yhwhXvj9FtRi7iUMbKPp04iN+o89iKHEKhM+ZNQip0bMVdI1+p3CH9D1S+f bubOAPRu9H+NJmYGLh2Bd7AEaG7EeUx4yL3IsAhSF4BMluUFSWuo/2wAU84RkWXbdTFc1DFWdC2Czw== Subject: [FFmpeg-devel] [PATCH 2/5] avcodec/allcodecs: Dont play with NULLs X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: TUb3VtVvkBzR Fixes: member access within null pointer of type 'const FFCodec' (aka 'const struct FFCodec') Fixes: 45726/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-6554445419249664 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/allcodecs.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c index b1aa7e266b..22d56760ec 100644 --- a/libavcodec/allcodecs.c +++ b/libavcodec/allcodecs.c @@ -882,10 +882,11 @@ const AVCodec *av_codec_iterate(void **opaque) ff_thread_once(&av_codec_static_init, av_codec_init_static); - if (c) + if (c) { *opaque = (void*)(i + 1); - - return &c->p; + return &c->p; + } + return NULL; } static enum AVCodecID remap_deprecated_codec_id(enum AVCodecID id) From patchwork Mon Mar 21 20:19:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 34881 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6838:ed11:0:0:0:0 with SMTP id hi17csp1960582nkc; Mon, 21 Mar 2022 13:21:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0Vbo1rECbSAHGv3RNJcuRcShqTHoaFYne4HbkZLCOjthO3Isq6fi59x0vKDc3W1yK0DMX X-Received: by 2002:a05:6402:4402:b0:418:ff4c:f102 with SMTP id y2-20020a056402440200b00418ff4cf102mr22582018eda.365.1647894072808; Mon, 21 Mar 2022 13:21:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647894072; cv=none; d=google.com; s=arc-20160816; b=egGYPOTJYH049dsu9c6zzGomxBVOWC7lHNzgT8IXIO5VNbygyprisf1Ci2iBCtv3Ta /3DSERZHUD/GytuaUbC5TbKmzWEOzor+x1Ki/7nuKEM7hF527eNwaznha6oYd1++JnGH MY8ENPO3fBG9SRkO9mlIYAVuD+tpTjeywh+a92Re+5KsOPoLsOUq8fXQft53c2RlR6BE XKd3f0wmj/2oVKSe6CJU+mvXCM63oRRfPPb0mZ842JqNRaa1NiOOXzFHefQSnHoM+VwD dtUFm0+08I3aAOlZq7p3jYYuVUGPwYhh2yoCO6X723G6rkqH140JiV1VrUmvHbzwrwIg v0fw== 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; bh=FGStjM8kd7CjB2YbqciRp6hgYn9FXfQ9zqGtuIafrPk=; b=ip3OCk/TMVvqGFryKYJE2E9Doe7z/FDQPw5TneMw9EV20+Q72AgSuRkWkN5Mk4yz2A W8Fc2QW++8nZ5udrMqZykVsiEmXsY//Xu1spbrrsD3KhmZTCNkm7sERbEFa9+MP/Fnx6 Dwax5anUMWQsGdzhKiT5NT5QiincOpgqLdSXhrbNWs5xQeBE8AjXjjA6tAVvky8sVnEV dSH1BlEKOnkFRr5QyU28Y6ICWoaVL9D49MBUJtHLbk+FTGGwpg8EL/P8KU2T5QIogm0b d1RuHgGEOx3DcXOoy/r3IIddrUWAOlqwCKB8gkfHVUYzh5/zqb8iV24cBfYXxYhPTQPK 95lQ== 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 c3-20020a1709063f0300b006df76385caasi8166884ejj.330.2022.03.21.13.21.12; Mon, 21 Mar 2022 13:21:12 -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 5ACD568B174; Mon, 21 Mar 2022 22:21:10 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-at03-3.mx.upcmail.net (vie01a-dmta-at03-3.mx.upcmail.net [62.179.121.153]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7C32268A656 for ; Mon, 21 Mar 2022 22:21:03 +0200 (EET) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-at03.mx.upcmail.net with esmtp (Exim 4.92) (envelope-from ) id 1nWOWV-00030k-57 for ffmpeg-devel@ffmpeg.org; Mon, 21 Mar 2022 21:21:03 +0100 Received: from ren-mail-psmtp-mg01. ([80.109.253.241]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id WOWVnckp4SgGFWOWVnNAap; Mon, 21 Mar 2022 21:21:03 +0100 Received: from localhost ([213.47.68.29]) by ren-mail-psmtp-mg01. with ESMTP id WOVInVhDYOPqFWOVInJl7S; Mon, 21 Mar 2022 21:19:48 +0100 X-Env-Mailfrom: michael@niedermayer.cc X-Env-Rcptto: ffmpeg-devel@ffmpeg.org X-SourceIP: 213.47.68.29 X-CNFS-Analysis: v=2.4 cv=OcX7sjfY c=1 sm=1 tr=0 ts=6238ddf2 a=2hcxjKEKjp0CzLx6oWAm4g==:117 a=2hcxjKEKjp0CzLx6oWAm4g==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=ZZnuYtJkoWoA:10 a=NEAV23lmAAAA:8 a=kaLpC4Z-mZCZhcdI_14A:9 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 21 Mar 2022 21:19:44 +0100 Message-Id: <20220321201946.16919-3-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220321201946.16919-1-michael@niedermayer.cc> References: <20220321201946.16919-1-michael@niedermayer.cc> X-CMAE-Envelope: MS4wfKH3XT/GAoipflDQbUD5paxHMRtRRiGJPlSG06RdRt3aHfKe8xLXfMLtp+zeIgB4Xv+DcOYplhSjH74kRVH03tqE011dcDwn9Cnumw60FXEFv392o1r/ tufZibxenBswwVdK1v3NJiI4RZ/GLgnr6JSCzCT4ETunA8O7OXVNCeuOJr7dO4adfDjZTap43VLFXg== Subject: [FFmpeg-devel] [PATCH 3/5] avcodec/vmdaudio: Fix channels count bug X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: p+R6/oAKSZtt Fixes: division by zero Fixes: 45811/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VMDAUDIO_fuzzer-6412592581574656 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/vmdaudio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/vmdaudio.c b/libavcodec/vmdaudio.c index 045a2da410..875930061a 100644 --- a/libavcodec/vmdaudio.c +++ b/libavcodec/vmdaudio.c @@ -85,7 +85,7 @@ static av_cold int vmdaudio_decode_init(AVCodecContext *avctx) } av_channel_layout_uninit(&avctx->ch_layout); - av_channel_layout_default(&avctx->ch_layout, channels == 1); + av_channel_layout_default(&avctx->ch_layout, channels); if (avctx->bits_per_coded_sample == 16) avctx->sample_fmt = AV_SAMPLE_FMT_S16; From patchwork Mon Mar 21 20:19:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 34882 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6838:ed11:0:0:0:0 with SMTP id hi17csp1960658nkc; Mon, 21 Mar 2022 13:21:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgALqsAdj8IOmjW+l897DymEJy87xSDJ4dOAYCj3Kd+tkiyzsYvSlZrqpxs9dN2cQOvHSW X-Received: by 2002:a17:907:97c7:b0:6da:b3ba:6d9f with SMTP id js7-20020a17090797c700b006dab3ba6d9fmr22881545ejc.256.1647894081570; Mon, 21 Mar 2022 13:21:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647894081; cv=none; d=google.com; s=arc-20160816; b=PgG7sysf7CXt4GdTV8b1twRm4ASd6VLH1y6VG/H1lWBIaK++lexHMndTc7YNGn5ijD dw7L24py8pcXKKtxWfst/lBNZluoo2obZF74ZREyBz6GGOWjcL1bYLBK4uhLldxaYbce EOhfPN90+6HX+TsqKtMToXfMfZeDJ/5uSIvVl5bhprxSIQ2FLGp4vKFbWEZTqC9KcD4/ shXsZg0xhaEBffE+iFs10bsB0EIJktgKau5sfcKgp9/VdDLPcMsNj0XC/36Eo50OdGa+ Kv0BdUS5B3NUw3W6BsIcqrWIu1S+JHd6dXx2ZO1Y3HKxqnGePoe6veq+8WImwKE6HOK0 cJoA== 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; bh=05uxnGCwfxdkfCg3wn5m5vqEjeFTJ4eCsqLzi1AmzZk=; b=qzHXg+RUR/yuQ0JGPOBSYwV00/exb4n2KI1SgLmcJBpC1/30+9pYsUi3TZlS3lPIr2 LXiy0pr7KZsKrGr9zF/agVKhTC7qvEkSn+SX9yKKN6FJaRDyD9zh4zuO0rWqemT8SbrT 83W9BB+ApgKmdhRT+/DSlKkk4bFfLNqXi8waOTJ+2puOClewL6YaAgvWHuC98NA1RdAV gh9Z9Q6aA7dCPrQqtNI1b9Hl/cUJEAdQFLRwhYQZM/lZrRXcyvOJtoA+IvgO1n36eLaw 33TbY/9NGT3dJWOJPygPsX8u4XqJmyyY32bl8fCubu5MpzQhJtk32zHj0T6SGZPKTvG/ 2bHw== 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 bw2-20020a170906c1c200b006df76385e40si7631033ejb.736.2022.03.21.13.21.21; Mon, 21 Mar 2022 13:21:21 -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 5C76D68B143; Mon, 21 Mar 2022 22:21:11 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-at03-3.mx.upcmail.net (vie01a-dmta-at03-3.mx.upcmail.net [62.179.121.153]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7C43C68AF34 for ; Mon, 21 Mar 2022 22:21:03 +0200 (EET) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-at03.mx.upcmail.net with esmtp (Exim 4.92) (envelope-from ) id 1nWOWV-0002v1-57 for ffmpeg-devel@ffmpeg.org; Mon, 21 Mar 2022 21:21:03 +0100 Received: from ren-mail-psmtp-mg01. ([80.109.253.241]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id WOVmncjdBSgGFWOWVnNAan; Mon, 21 Mar 2022 21:21:03 +0100 Received: from localhost ([213.47.68.29]) by ren-mail-psmtp-mg01. with ESMTP id WOVInVhDbOPqFWOVInJl7T; Mon, 21 Mar 2022 21:19:48 +0100 X-Env-Mailfrom: michael@niedermayer.cc X-Env-Rcptto: ffmpeg-devel@ffmpeg.org X-SourceIP: 213.47.68.29 X-CNFS-Analysis: v=2.4 cv=OcX7sjfY c=1 sm=1 tr=0 ts=6238ddf2 a=2hcxjKEKjp0CzLx6oWAm4g==:117 a=2hcxjKEKjp0CzLx6oWAm4g==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=ZZnuYtJkoWoA:10 a=NEAV23lmAAAA:8 a=IJxozggTPz9AYRMQTaoA:9 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 21 Mar 2022 21:19:45 +0100 Message-Id: <20220321201946.16919-4-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220321201946.16919-1-michael@niedermayer.cc> References: <20220321201946.16919-1-michael@niedermayer.cc> X-CMAE-Envelope: MS4wfKH3XT/GAoipflDQbUD5paxHMRtRRiGJPlSG06RdRt3aHfKe8xLXfMLtp+zeIgB4Xv+DcOYplhSjH74kRVH03tqE011dcDwn9Cnumw60FXEFv392o1r/ tufZibxenBswwVdK1v3NJiI4RZ/GLgnr6JSCzCT4ETunA8O7OXVNCeuOJr7dO4adfDjZTap43VLFXg== Subject: [FFmpeg-devel] [PATCH 4/5] avcodec/diracdec: avoid signed integer overflow in global mv X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: NjYZQizBgW5R Fixes: signed integer overflow: -128275513086 * -76056576 cannot be represented in type 'long' Fixes: 45818/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5129799149944832 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/diracdec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c index d5c095c689..12f97feb6b 100644 --- a/libavcodec/diracdec.c +++ b/libavcodec/diracdec.c @@ -1433,8 +1433,8 @@ static void global_mv(DiracContext *s, DiracBlock *block, int x, int y, int ref) int *c = s->globalmc[ref].perspective; int64_t m = (1<u.mv[ref][0] = (mx + (1<<(ez+ep))) >> (ez+ep); block->u.mv[ref][1] = (my + (1<<(ez+ep))) >> (ez+ep); From patchwork Mon Mar 21 20:19:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 34883 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6838:ed11:0:0:0:0 with SMTP id hi17csp1960747nkc; Mon, 21 Mar 2022 13:21:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWJe5WZnrAa0diB9fcYuJsYwjnVibg3V+Z3fZAzEAzmYhJj+a6CP78XMa/2PzzHmqRjGKR X-Received: by 2002:a17:906:9f0f:b0:6e0:3010:8a8f with SMTP id fy15-20020a1709069f0f00b006e030108a8fmr3202982ejc.225.1647894091018; Mon, 21 Mar 2022 13:21:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647894091; cv=none; d=google.com; s=arc-20160816; b=xD/oHnAfd99RQLqeisGIw5Mi0ecvMu8CUmyKi8X8wqcXFSRW3+ygbMBYFO27DETT6P vEA3Obyvq8RV/o/YDu+Q9seSIbifUmqA09g8TvvKeg1cmiQ4ntKJDy73j0ncKSako7UK NCU41+QfGkIhYjA7+zf+eydFPnENjKzOXiV9cCFXpR4cCCD/QSQIoUcuEkJ5cEFQzFez z2Mcc9i84EvjYcPXlhSDQns+qBdSBO9Qu23QI02LcNfgk9bbMlGu/JINsG6gLXsJ/xkw BQlozh8aCLsF0usv8PAgKImg80DHoC7TFDnpgp9JbYN0xtwtw1bmpu5S44ppy1X2XQcD hR2g== 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; bh=FQhXyGQgFjGPpnFZr5YdC5jcBpIQrsV2EK/sqCAF+Bg=; b=0HFinBBbXcdmDsEqVYClu/FD0fEYSA4+dBZGgblYfFlVm5D/oaicPQSAytfOtVh/Yr 8OkkU9fL0c1vaUvfDpGr+14n8cZVv0bgVTgdYPTjNCgKiGUVU/Cc32w6ivRGsV4SbMat UlGbcKVS9YXZfneHlE6DnGETyfZPc7OHtCjP9Hf3+hIooCnoOujPO+aX6OSUZBSaiEYC vqR/9W/sF0zpD+A7wg0xmC/viKD3FelhnXCCTNmJeAwZEkxHfut89qxrgIXCvO/IfW7g hxLkKHaQbsgtK3To9Y8Ej2PYZYNa2s8lP2SeamwEe4ibNB5iXHlfnm+WTcuXkOwY+WL0 a9xw== 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 q14-20020a50cc8e000000b004190a5a2987si8844239edi.430.2022.03.21.13.21.30; Mon, 21 Mar 2022 13:21:31 -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 576A568B185; Mon, 21 Mar 2022 22:21:12 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-at01-3.mx.upcmail.net (vie01a-dmta-at01-3.mx.upcmail.net [62.179.121.147]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7E93968B0F9 for ; Mon, 21 Mar 2022 22:21:03 +0200 (EET) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-at01.mx.upcmail.net with esmtp (Exim 4.92) (envelope-from ) id 1nWOWV-00Ghof-5D for ffmpeg-devel@ffmpeg.org; Mon, 21 Mar 2022 21:21:03 +0100 Received: from ren-mail-psmtp-mg01. ([80.109.253.241]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id WOWVnckp3SgGFWOWVnNAao; Mon, 21 Mar 2022 21:21:03 +0100 Received: from localhost ([213.47.68.29]) by ren-mail-psmtp-mg01. with ESMTP id WOVInVhDkOPqFWOVInJl7W; Mon, 21 Mar 2022 21:19:48 +0100 X-Env-Mailfrom: michael@niedermayer.cc X-Env-Rcptto: ffmpeg-devel@ffmpeg.org X-SourceIP: 213.47.68.29 X-CNFS-Analysis: v=2.4 cv=OcX7sjfY c=1 sm=1 tr=0 ts=6238ddf2 a=2hcxjKEKjp0CzLx6oWAm4g==:117 a=2hcxjKEKjp0CzLx6oWAm4g==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=ZZnuYtJkoWoA:10 a=NEAV23lmAAAA:8 a=hbWDiSJ8O4ovbG1I8Y0A:9 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 21 Mar 2022 21:19:46 +0100 Message-Id: <20220321201946.16919-5-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220321201946.16919-1-michael@niedermayer.cc> References: <20220321201946.16919-1-michael@niedermayer.cc> X-CMAE-Envelope: MS4wfKH3XT/GAoipflDQbUD5paxHMRtRRiGJPlSG06RdRt3aHfKe8xLXfMLtp+zeIgB4Xv+DcOYplhSjH74kRVH03tqE011dcDwn9Cnumw60FXEFv392o1r/ tufZibxenBswwVdK1v3NJiI4RZ/GLgnr6JSCzCT4ETunA8O7OXVNCeuOJr7dO4adfDjZTap43VLFXg== Subject: [FFmpeg-devel] [PATCH 5/5] avcodec/exr: Avoid signed overflow in displayWindow X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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" X-TUID: lXfs7AwOUyjf The inputs are unused except for this computation so wraparound does not give an attacker any extra values as they are already fully controlled Fixes: signed integer overflow: 0 - -2147483648 cannot be represented in type 'int' Fixes: 45820/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-5766159019933696 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/exr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/exr.c b/libavcodec/exr.c index dd5924245f..f338ff0085 100644 --- a/libavcodec/exr.c +++ b/libavcodec/exr.c @@ -1833,8 +1833,8 @@ static int decode_header(EXRContext *s, AVFrame *frame) dx = bytestream2_get_le32(gb); dy = bytestream2_get_le32(gb); - s->w = dx - sx + 1; - s->h = dy - sy + 1; + s->w = (unsigned)dx - sx + 1; + s->h = (unsigned)dy - sy + 1; continue; } else if ((var_size = check_header_variable(s, "lineOrder",