From patchwork Mon May 8 12:43:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 3616 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.3.129 with SMTP id 123csp828930vsd; Mon, 8 May 2017 05:43:16 -0700 (PDT) X-Received: by 10.28.93.13 with SMTP id r13mr12596062wmb.39.1494247396397; Mon, 08 May 2017 05:43:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1494247396; cv=none; d=google.com; s=arc-20160816; b=SAV7YwG8bY5Z0a8/jRjyidPLWZMx08+LmPF44ysDPw9vAilTCtkcVtUAWbqocTWC1W ZLiGykzif3o6hP9OnXsWDhFoHEvOrcLWme1x8s3Xre3WmYo5/FCuzjaCiRXX2Unts6HK lYoHv7GeO26rizVcSOgsGuzWQHrYetVuA/K4P8IO/IYvXUKLpkvdOpu9aNohrNmZqMrF 8QRVNixDLzb7/xs63D8XaxEoujhM/pl1TFS+F6xp5s8xarxgBrr4EKYhHG/Mm8d26dJz /1393QZt4F1lApRYX75n+wP+6W03QKiYytubEpoYRmfWKasewKuU4/K0Fm1QiMIyzhme jDbQ== 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=R66V3uR/f0eSYoixM0+BnKzddixxxcF/XSRqd1F69L4=; b=N84sXbDUmfJpO7cjSls4vEdhUAg39WMmst4nfIfotzIqkupBzPN1SEO4cjCAUJoj0j HAhivtiAVsY8sspGUUcJKSOnHWltnuLdt4Ra3oAnaLONpavXjvRDPaG3Dc1zQAhtKTKT Lo2dj0hcKbBO2w36bmqNgf7Nn1jHbYJCPH2pkaI46w1pwi1q6h/rHVVCU1rylutD6vIr G0WKI2wiSHSJi5vmbfrGjJBajJG+Rm8TjwWyKHLLK8h7QP/FBJoXCHTZbvXX4tiiXx31 mq3o2qcr2tYDz+Amk47Lf98cLdrOnVQGnl3JIYnZyWJl7oti2hiYlIBcbhkVn3Hkxkr2 Umag== 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 n6si14845787wrn.211.2017.05.08.05.43.15; Mon, 08 May 2017 05:43:16 -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 16BD668828A; Mon, 8 May 2017 15:43:07 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe04-2.mx.upcmail.net (vie01a-dmta-pe04-2.mx.upcmail.net [62.179.121.164]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DEF506806CB for ; Mon, 8 May 2017 15:43:00 +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 1d7i0I-0007I7-BW for ffmpeg-devel@ffmpeg.org; Mon, 08 May 2017 14:43:06 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id Hoj41v00C0S5wYM01oj59f; Mon, 08 May 2017 14:43:05 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 8 May 2017 14:43:01 +0200 Message-Id: <20170508124303.12267-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.11.0 Subject: [FFmpeg-devel] [PATCH 1/3] avcodec/webp: Check for VP8X after other VP8 chunks 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" Signed-off-by: Michael Niedermayer --- libavcodec/webp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavcodec/webp.c b/libavcodec/webp.c index d21536a286..a4fd295250 100644 --- a/libavcodec/webp.c +++ b/libavcodec/webp.c @@ -1423,6 +1423,10 @@ static int webp_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, bytestream2_skip(&gb, chunk_size); break; case MKTAG('V', 'P', '8', 'X'): + if (s->width || s->height || *got_frame) { + av_log(avctx, AV_LOG_ERROR, "Canvas dimensions are already set\n"); + return AVERROR_INVALIDDATA; + } vp8x_flags = bytestream2_get_byte(&gb); bytestream2_skip(&gb, 3); s->width = bytestream2_get_le24(&gb) + 1;