From patchwork Tue Feb 27 15:53:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 7756 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.181.170 with SMTP id m39csp2705043jaj; Tue, 27 Feb 2018 07:53:36 -0800 (PST) X-Google-Smtp-Source: AH8x225kn29XhNjiTICiyi/fAVh3Cytoo4qDC72Qt2llWJtoUu2EnkmDLIbuvmRN4okwX91lfe3s X-Received: by 10.28.32.216 with SMTP id g207mr12303016wmg.21.1519746816446; Tue, 27 Feb 2018 07:53:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519746816; cv=none; d=google.com; s=arc-20160816; b=MDLGAoMhGrkk09BwckHhIUwKup9ePRYAtAKk2tCME6g1OaO9vfVrR/k2dTaFUJqL1J 3S0xS6afez5DE4eFCyX5uDhWl5CbI42+2OrQpYR/kl2r7+Fwgdhr3IvELbeJM7WuRqml n+8aPu3dZvK4z2QK+8+deknNf4fW0KyxnAk0KaW1a1oMstZx1MIHXKTWl8LO5Rd25Blr lVJiglBjR9oaORdAUnRDp8pCHTrff7thJXi1OpxGYizD3iX51B49zFsdKdibMFXpFlwF WyDrKX9W5WS923U6uKNVVdg+D05WsU9FlSrcLyjGniWnXvDkFOut3EsQ5ZOuQ8vfm+I4 RKKA== 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 :arc-authentication-results; bh=j5jAo9DH/uJCwPI115TyK1fd9fLjCSVEx0WfgtO9W20=; b=Q/e+AwllNHGdThAVn+YFaNtM2z93LfYLB4qX4vlOG1BfI3o9G3WIKQcsGv00Fxfxcx hl4JawwYGUX0/K+zftPGEU8bTO9EOy93CAGeGc5tEwh06T1RTUUTjucD5Fo1swLijmet YaafFi/DV6i3v1mtF3+HituEJh/ebcYYavhPP2496jXT54CWFS9xa8bxHnArZEXEk78q PuVw1BS2frAbdiz5s36kCJ2aZFir1skpWfF+0e73YA08ceQLK70n7iXnR1FwGXcGuLZh 7igVxOcWbe5UHNH2M+V2+RvVd0w7AiCwhjaY2K3n09r/HGid0KXFWxgALXRMuyZILUzp Znlw== 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 s4si2990350wrb.241.2018.02.27.07.53.36; Tue, 27 Feb 2018 07:53:36 -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 1EFB268A3D7; Tue, 27 Feb 2018 17:53:30 +0200 (EET) 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 30386689C73 for ; Tue, 27 Feb 2018 17:53:24 +0200 (EET) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe03.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1eqhZI-0006JU-C1 for ffmpeg-devel@ffmpeg.org; Tue, 27 Feb 2018 16:53:28 +0100 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id FrtR1x00g0S5wYM01rtSAF; Tue, 27 Feb 2018 16:53:26 +0100 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Tue, 27 Feb 2018 16:53:23 +0100 Message-Id: <20180227155324.3220-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.16.2 Subject: [FFmpeg-devel] [PATCH 1/2] avcodec/nuv: rtjpeg with dimensions less than 16 would result in no decoded pixels thus reject it 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: Timeout Fixes: 6297/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_NUV_fuzzer-4882404863901696 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/nuv.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/nuv.c b/libavcodec/nuv.c index ad6c029e50..15165ae3f5 100644 --- a/libavcodec/nuv.c +++ b/libavcodec/nuv.c @@ -198,6 +198,9 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, case NUV_RTJPEG_IN_LZO: case NUV_RTJPEG: keyframe = !buf[2]; + if (c->width < 16 || c->height < 16) { + return AVERROR_INVALIDDATA; + } break; case NUV_COPY_LAST: keyframe = 0;