From patchwork Mon Jun 21 21:25:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 28593 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2042:0:0:0:0 with SMTP id z2csp2343987iod; Mon, 21 Jun 2021 14:27:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUcvE/CDMbh+vqpea17HV8R+r1kmSPuODlwAmG4Is/BXIAxGrNl0ErcMaFnK7UL5cH76jD X-Received: by 2002:a50:9e6b:: with SMTP id z98mr551302ede.210.1624310830581; Mon, 21 Jun 2021 14:27:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624310830; cv=none; d=google.com; s=arc-20160816; b=M+tPscjAaZV1Miu0qsYwStqgv6fp4AyWa79rSlKg6hojMEAXOBMd7zsL8X0IYYrM1K VEyD5lfmhXtxAT28/m34rsJBmVW2IVS8Y3dGaC+KC6xK5tImJDQWELSbBZU9tNet5xw9 shv0wLeORDHPxdxllr6mZeeg5aZ6V6JwGWik+fGrzsefaQ4DdRte9Dgtwb7WmPcG24wf /K+K80rZnp5uXWOKMQ7e27Sa0i8uRnL0LsKj9SJ9OuubvLs9YV9RH1vyvILmRYToKhZ7 gtlPyyZE52qVwGeDBmmArFAck1DJSToZzOTXytXz5nBzX2CJuOXMxzaRrcViLKQQ0iOa Bhng== 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=8iPR0koiDngtiFp49iHCKZOk255WLtpaltBvSHlE2ew=; b=RGW2OwFFBZ5VGYiXfAkv3ZR4HB4GrBiWfs3w++2PWXVg59GqkVWhmDkRgI8XyQFAMW 3vUSJWEvnwfUj1zkgZ8wl946WYGm546C/UZEvYcGKPGP4bkXdNnyLxX6BfecU0HwPXzW DN2t0FC6+UoaZTesjiH5kt0W0uGXmjbJQKa4u7LOsuhN6WjtM1jv5N7Olwq6egQHmBHU b4ziEuHM6GgtNJ2eNpUHZlnpK6M2kYyZD9H3R9qw05jaKaUT6qmaQ7yjZcoQ+1QWJnPm mOEWZ0DnKz/NXPo3JvMOysFKZAvcscVRSCgBcGAEu52eWuLos5JSTt7HfP9cBeBv/dmW 6KjA== 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 r15si18988963edx.343.2021.06.21.14.27.09; Mon, 21 Jun 2021 14:27:10 -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 EA2506898E4; Tue, 22 Jun 2021 00:26:54 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe03-3.mx.upcmail.net (vie01a-dmta-pe03-3.mx.upcmail.net [62.179.121.162]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id ED548689D32 for ; Tue, 22 Jun 2021 00:26:46 +0300 (EEST) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-pe03.mx.upcmail.net with esmtp (Exim 4.92) (envelope-from ) id 1lvRRN-004Fiz-0D for ffmpeg-devel@ffmpeg.org; Mon, 21 Jun 2021 23:26:45 +0200 Received: from localhost ([213.47.68.29]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id vRQOl0M3uljeHvRQOlc6QP; Mon, 21 Jun 2021 23:25:45 +0200 X-Env-Mailfrom: michael@niedermayer.cc X-Env-Rcptto: ffmpeg-devel@ffmpeg.org X-SourceIP: 213.47.68.29 X-CNFS-Analysis: v=2.3 cv=BoHjPrf5 c=1 sm=1 tr=0 a=2hcxjKEKjp0CzLx6oWAm4g==:117 a=2hcxjKEKjp0CzLx6oWAm4g==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=ZZnuYtJkoWoA:10 a=nZOtpAppAAAA:20 a=KI2OfjKSR4ISLy7_ywMA:9 a=1fhp2MxaeJtTNGEnv6mo:22 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 21 Jun 2021 23:25:42 +0200 Message-Id: <20210621212544.15449-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 X-CMAE-Envelope: MS4wfPB7h9lGiyBCJka6qvSxX4Q4CEQw9jhheVzjosW0H0CvNaPBL8Gbu9HhVlRW+gx31IJvGa228r/d0bfGN/DYhsQC/F4T8L+UmlCblJJE0c0nKpp1A3C0 29wOyCEx7i1XfpAsCWeKaVP9SnC8ZjrE2CyuY+xhUFy1yrPa1KkO4wtp Subject: [FFmpeg-devel] [PATCH 1/3] avcodec/clearvideo: Check tile_size to be not too large 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: 3kmR2ks+sb2s Fixes: left shift of 1 by 31 places cannot be represented in type 'int' Fixes: 35023/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CLEARVIDEO_fuzzer-6740166587842560 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/clearvideo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/clearvideo.c b/libavcodec/clearvideo.c index 5c79376c64..5ed8ac71dc 100644 --- a/libavcodec/clearvideo.c +++ b/libavcodec/clearvideo.c @@ -722,8 +722,8 @@ static av_cold int clv_decode_init(AVCodecContext *avctx) } c->tile_shift = av_log2(c->tile_size); - if (1U << c->tile_shift != c->tile_size || c->tile_shift < 1) { - av_log(avctx, AV_LOG_ERROR, "Tile size: %d, is not power of 2 > 1\n", c->tile_size); + if (1U << c->tile_shift != c->tile_size || c->tile_shift < 1 || c->tile_shift > 30) { + av_log(avctx, AV_LOG_ERROR, "Tile size: %d, is not power of 2 > 1 and < 2^31\n", c->tile_size); return AVERROR_INVALIDDATA; } From patchwork Mon Jun 21 21:25:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 28592 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2042:0:0:0:0 with SMTP id z2csp2343871iod; Mon, 21 Jun 2021 14:26:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyfSc7j0NV87Wg/vIJBUpxKTmxk4AGZtefqkaDs4SLIVAfoo905f/JB2poXvy247xT1q9Vo X-Received: by 2002:a17:906:4882:: with SMTP id v2mr203010ejq.134.1624310818979; Mon, 21 Jun 2021 14:26:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624310818; cv=none; d=google.com; s=arc-20160816; b=hWzt4mAj3+OzqKtYG/IVcLYasnlaosgUChtgdLAM9OZ9jCgdBxGhOsvgkwzU7XoPzM uAWTxqnOI3tdhSeEy7ycPLVa5296bCUZzRNl7PMM2vGq5xYrCG/0CRc+MB7kelokGfAk yGmh40YaO/Lrks96njmS0n5MT/y1Dt1dPc+XgArFHkPTdIhyz0dKaOulbZkloZfGPjSd dHDlm4qwOgY9S1TewNJFKfJzWBP4r9nckE8pfdrT3NSLnZOOduLvf+aJLY5vCaHc3JhU 3CULxCia8w/fsWE8iZaIdQvcYq9gOjlGvV3MoVQZB0SP4jfJJpbw+xKjJFae455UIgH2 3NKw== 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=NXrRo/aB6s2S017cDwMbFNsOMYCWhN7w3ECdaTOP7mc=; b=ddsdjJlu4JFmObx7WfYB861qN9VF6qkn5oa2xf6hjqgwY4/mcJueCcDstcsc8TYNx/ wfiOaDWlSPqGh01X7KOAceCjWdLi7g+4Cn/KwnniFyB6zpOG+wB3DkfH7n9qsJQBKhfW CNsCRv2ZvxONRRAzmF78DlEemYDkc6UaJmBA8oy3m3fd6Zk4Hhvl3zGUDNV4CYBBH1CT Rt/atqPPN5MfD53K9gwyVrnY3FDLdv+b0yezGWZ1UwMeXuQ+anC1aGG8O4c3jMBlNwAe kxRhhaqPa06I/2HAErKb8VVBJhz5j6gnCTmAMerZsj1AWfKaGOdFawnOZh8cS5RHMsJn l8FA== 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 s13si15044025edy.85.2021.06.21.14.26.58; Mon, 21 Jun 2021 14:26:58 -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 F02DD689F00; Tue, 22 Jun 2021 00:26:53 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe03-3.mx.upcmail.net (vie01a-dmta-pe03-3.mx.upcmail.net [62.179.121.162]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id EC4F568052B for ; Tue, 22 Jun 2021 00:26:46 +0300 (EEST) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-pe03.mx.upcmail.net with esmtp (Exim 4.92) (envelope-from ) id 1lvRRN-004Fiu-0E for ffmpeg-devel@ffmpeg.org; Mon, 21 Jun 2021 23:26:45 +0200 Received: from localhost ([213.47.68.29]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id vRQPl0M4pljeHvRQPlc6Qu; Mon, 21 Jun 2021 23:25:45 +0200 X-Env-Mailfrom: michael@niedermayer.cc X-Env-Rcptto: ffmpeg-devel@ffmpeg.org X-SourceIP: 213.47.68.29 X-CNFS-Analysis: v=2.3 cv=BoHjPrf5 c=1 sm=1 tr=0 a=2hcxjKEKjp0CzLx6oWAm4g==:117 a=2hcxjKEKjp0CzLx6oWAm4g==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=ZZnuYtJkoWoA:10 a=nZOtpAppAAAA:20 a=OI1zSjG8bbiHpuWw3DcA:9 a=1fhp2MxaeJtTNGEnv6mo:22 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 21 Jun 2021 23:25:43 +0200 Message-Id: <20210621212544.15449-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210621212544.15449-1-michael@niedermayer.cc> References: <20210621212544.15449-1-michael@niedermayer.cc> X-CMAE-Envelope: MS4wfPB7h9lGiyBCJka6qvSxX4Q4CEQw9jhheVzjosW0H0CvNaPBL8Gbu9HhVlRW+gx31IJvGa228r/d0bfGN/DYhsQC/F4T8L+UmlCblJJE0c0nKpp1A3C0 29wOyCEx7i1XfpAsCWeKaVP9SnC8ZjrE2CyuY+xhUFy1yrPa1KkO4wtp Subject: [FFmpeg-devel] [PATCH 2/3] avcodec/exr: Better size checks 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: 2PZz6eAWzy3h Fixes: signed integer overflow: 3530839700044513368 + 8386093932303352321 cannot be represented in type 'long long' Fixes: 35182/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-5398383270428672 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/exr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/exr.c b/libavcodec/exr.c index 4648ed7d62..e7387ffd66 100644 --- a/libavcodec/exr.c +++ b/libavcodec/exr.c @@ -1014,7 +1014,7 @@ static int dwa_uncompress(EXRContext *s, const uint8_t *src, int compressed_size dc_count = AV_RL64(src + 72); ac_compression = AV_RL64(src + 80); - if (compressed_size < 88LL + lo_size + ac_size + dc_size + rle_csize) + if (compressed_size < (uint64_t)(lo_size | ac_size | dc_size | rle_csize) || compressed_size < 88LL + lo_size + ac_size + dc_size + rle_csize) return AVERROR_INVALIDDATA; bytestream2_init(&gb, src + 88, compressed_size - 88); From patchwork Mon Jun 21 21:25:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 28594 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2042:0:0:0:0 with SMTP id z2csp2347934iod; Mon, 21 Jun 2021 14:33:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwU4vc+A31cBPMMJpAMcaV7FDba4tpZChoevySmraTYiv8SIHktAgeB+yxX4dBicxo+fPgw X-Received: by 2002:a17:906:4786:: with SMTP id cw6mr189022ejc.353.1624311195513; Mon, 21 Jun 2021 14:33:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624311195; cv=none; d=google.com; s=arc-20160816; b=z1LqQOdxZJErubnUYQTRIVFgm9Z+SIfq9152Sjp5yWC4PC9kzfkRRQeDWKIcAzOhr0 DIbOfDwhXZPjXINBI513SkyZiKoRYMZ/X6MxtFBbD5zzWY6j9bWpBJsknoXsGQYFFTPG I4vgYwykCesFgZ5kJJE1Z7uy236K3oI37QnX3CWol9rKKKNHOBAAeI9NGP7v8/FvEOVW /JZEsFEBpOVjeI+dwPuuUPEkDI371QiFf5KFLXyWMEdJYn6xAd9MXR+6JK7dasXH9Gze HBs+2V7Xwno10dv7UmK3puRQFWHwRHUBnScfDYX11Ayj8Yw1U+1hoThIqJbH3hyPw7H/ y1rA== 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=M5ljWj6wu1pmOkrG5+qzFNOLI0yrVdE8vmajdHNjFq4=; b=KIuicmm4zK49LY0iPQdADIANOYiIiIj7fqSzS5AYKUiiV6t5B81R9Rr8aZ9J4dABpY EqxUu8vUjTwpuXUAKlKrnH1jW3Ayn9t2/9rBptt5AYft7XeVA0+8beLySq36+SPp2IZ4 fv8OVR1cKiAE5XyxXhrph2neEM461RMMCfBVQOi/FkHNB3Eo/SRFKmgqBPn4wQs6d02A 2Xnw8Xoy9E95inXk/zpHvUkCP/EigOS/f6qckjFpis1jYQPz7nT2YWEghd3Y1qjb0Q2r 6UhqzqwjnEftlLPaSeTSI9IiDdZT0S7SAW8V3YuiM60J8L9AhE4+LhVnOQaw2Zu6NTV4 NbDQ== 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 q19si8716785edv.394.2021.06.21.14.33.15; Mon, 21 Jun 2021 14:33:15 -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 7D364689B7F; Tue, 22 Jun 2021 00:33:12 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe04-1.mx.upcmail.net (vie01a-dmta-pe04-1.mx.upcmail.net [62.179.121.163]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4438A6807C8 for ; Tue, 22 Jun 2021 00:33:05 +0300 (EEST) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-pe04.mx.upcmail.net with esmtp (Exim 4.92) (envelope-from ) id 1lvRRN-00Awh9-0E for ffmpeg-devel@ffmpeg.org; Mon, 21 Jun 2021 23:26:45 +0200 Received: from localhost ([213.47.68.29]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id vRQPl0M56ljeHvRQPlc6R6; Mon, 21 Jun 2021 23:25:45 +0200 X-Env-Mailfrom: michael@niedermayer.cc X-Env-Rcptto: ffmpeg-devel@ffmpeg.org X-SourceIP: 213.47.68.29 X-CNFS-Analysis: v=2.3 cv=BoHjPrf5 c=1 sm=1 tr=0 a=2hcxjKEKjp0CzLx6oWAm4g==:117 a=2hcxjKEKjp0CzLx6oWAm4g==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=ZZnuYtJkoWoA:10 a=nZOtpAppAAAA:20 a=4lFjYQbWvxT0W21MsFcA:9 a=1fhp2MxaeJtTNGEnv6mo:22 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 21 Jun 2021 23:25:44 +0200 Message-Id: <20210621212544.15449-3-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210621212544.15449-1-michael@niedermayer.cc> References: <20210621212544.15449-1-michael@niedermayer.cc> X-CMAE-Envelope: MS4wfPB7h9lGiyBCJka6qvSxX4Q4CEQw9jhheVzjosW0H0CvNaPBL8Gbu9HhVlRW+gx31IJvGa228r/d0bfGN/DYhsQC/F4T8L+UmlCblJJE0c0nKpp1A3C0 29wOyCEx7i1XfpAsCWeKaVP9SnC8ZjrE2CyuY+xhUFy1yrPa1KkO4wtp Subject: [FFmpeg-devel] [PATCH 3/3] avcodec/cpia: Fix missing src_size update 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: XrNspQqomJzh Fixes: out of array read Fixes: 35210/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CPIA_fuzzer-5669199688105984 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/cpia.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/cpia.c b/libavcodec/cpia.c index d88bd1aae7..a2ae16ec2c 100644 --- a/libavcodec/cpia.c +++ b/libavcodec/cpia.c @@ -111,6 +111,7 @@ static int cpia_decode_frame(AVCodecContext *avctx, // Read line length, two byte little endian linelength = AV_RL16(src); src += 2; + src_size -= 2; if (src_size < linelength) { frame->decode_error_flags = FF_DECODE_ERROR_INVALID_BITSTREAM;