From patchwork Wed Dec 23 11:35:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul B Mahol X-Patchwork-Id: 24634 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 16A0C44A7B2 for ; Wed, 23 Dec 2020 13:35:58 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 03E2268AB0D; Wed, 23 Dec 2020 13:35:58 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1215968AB03 for ; Wed, 23 Dec 2020 13:35:50 +0200 (EET) Received: by mail-ej1-f44.google.com with SMTP id x16so22396890ejj.7 for ; Wed, 23 Dec 2020 03:35:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=lxkVmWXlpmtg+WWYRihls/LwgDnNIlpl78AIrjqtb9E=; b=DUIh4P1CqmwavCZ2HIbhohU3P4S7c7tvDIYCerRbH5IR82s6mWnqZFont6ozh5iw2A 92YbjU9mto+arALLZPIY9vtliln55A0D10vSxwn59FadhCjtUwRixQCSL/wC1SyM5Rwr mobZDWpaXCYuq7i5SZ1YYfLoM8IwrTL41BPftuikstInoXwqIwO+RyghamxQ36tceIiN Nb07Cr4KdB17eaM5AtJ09Ml0LpQFIUa9sUU14b070txGkhYA8493ql6XCSvCxzfNZPPY nlt4VfXl1J3O4mhxtDZ9CCmqEeY55Kv7zKhVCA9OxUsuBHSek7OAvUDZbuWlvLX7/F2S 49pQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=lxkVmWXlpmtg+WWYRihls/LwgDnNIlpl78AIrjqtb9E=; b=J2C8CtZBDjgEb6Mgw4ST6Lm2z74tzC/gCF108G6w1StTlInjRWt/yYTV609eCRsrKd yyqmz2iuA+0AZltm4UNIRcZJjVJmfyNKaX3xK0B2q9baNs7cTZ8nyfq9vNlEm1W6taVE ye/L+P0PQ1O8noc//Ti+bQmlmbsq+lRmTYyGAjG+k4WRYXl0P4ojn+nXAjWUgRw/Aaaf 3SPy7A7njECgqkQQJZA3gu+Sm38rhoHOhE8JkanMyICXigc6WLqxrvk1mOc4trPglgZl 1rAUBzam5/UloMRee/k/tkX5aU67OVlh4/hCshB+xr98sqAFg0CXI947LDFLn52QWpya WB6w== X-Gm-Message-State: AOAM530gN+6F/8Sq/AwcgiV9wQj2RDDQ5JxQ26/UQu5HTUoaSZbdv/sR SFVDFm2UcLgCNu8qOg0w1w2WHkSEz3jfIg== X-Google-Smtp-Source: ABdhPJwqkIswyvYMi1TJAnfRU0/3VmPelpzobZQajCbkvtgne0Yz5MLhhvSTM7vTM7e4wXz0x3hkMA== X-Received: by 2002:a17:906:229a:: with SMTP id p26mr23570992eja.291.1608723349614; Wed, 23 Dec 2020 03:35:49 -0800 (PST) Received: from localhost.localdomain ([31.45.254.141]) by smtp.gmail.com with ESMTPSA id ld2sm11496574ejb.73.2020.12.23.03.35.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Dec 2020 03:35:49 -0800 (PST) From: Paul B Mahol To: ffmpeg-devel@ffmpeg.org Date: Wed, 23 Dec 2020 12:35:39 +0100 Message-Id: <20201223113539.19880-2-onemda@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201223113539.19880-1-onemda@gmail.com> References: <20201223113539.19880-1-onemda@gmail.com> Subject: [FFmpeg-devel] [PATCH 2/2] avcodec/cfhd: properly handle midstream size changes for transform type 2 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: Paul B Mahol --- libavcodec/cfhd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/cfhd.c b/libavcodec/cfhd.c index a4f4cb4b3c..ae0d4b9496 100644 --- a/libavcodec/cfhd.c +++ b/libavcodec/cfhd.c @@ -1372,6 +1372,9 @@ static int update_thread_context(AVCodecContext *dst, const AVCodecContext *src) if (dst == src || psrc->transform_type == 0) return 0; + if (pdst->plane[0].idwt_size != psrc->plane[0].idwt_size) + free_buffers(pdst); + pdst->a_format = psrc->a_format; pdst->a_width = psrc->a_width; pdst->a_height = psrc->a_height;