From patchwork Thu Dec 6 10:56:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul B Mahol X-Patchwork-Id: 11302 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 27A9344C89D for ; Thu, 6 Dec 2018 12:56:54 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C419768A7B5; Thu, 6 Dec 2018 12:56:45 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7783268A6EE for ; Thu, 6 Dec 2018 12:56:39 +0200 (EET) Received: by mail-wm1-f49.google.com with SMTP id c126so557569wmh.0 for ; Thu, 06 Dec 2018 02:56:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=yY+TqmCMWORGCYQKZke8Zv1GtfQWvbUuYkOVu6AWT2A=; b=ENxkQyar215Jsp6vvK0+HR6JxwaiWIQBwfVlIuz/Sk7dONv5UWdtBo6wVzCVRfuwKI KCLK8GnaJXGpC8dGCQl8XnOgtPoB5j+p7GceM0rv7dE5nUxs+DPpH9akyvnLvG6khAt+ 21roTQHxtgrRsa1aQfcIdnkAoUiM22CYbmnVFv3uCKTfOyoBzEi8FMs95vhVaE1MZ8M6 rK568O2S+k4fnuMWF/hBkaYqhl9j3MJxi8gUymLCiV4t3YBizlBOc0SyicvfEji72DhE y7YuyriLA3FyvMJ8qpzMXzmAYRizgEEd/r3Xhn12wCIE/ICslJC9Zw8h+pFaizFTgQUh HGzg== 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; bh=yY+TqmCMWORGCYQKZke8Zv1GtfQWvbUuYkOVu6AWT2A=; b=b7l48LimNcNIdneof4lVIIp9fvBePMpi0pEfwkE7GorfTwc0FkOHHyYRUrW6RVNxhc B9qCoG20Vaj9xKn/duogLzZsm1gO+707oZzp96uQTtl0S39/CoJdeR3gabJ+LHcI2eKS jErVBMRlpk5a0edNz8/uqHpPq7anAdQyXpot0AvZJ7vg7U81XIaVq4qiCBuJuFXLEtxJ y3Mj/gK1PMLL2+6gH3o7keWhzTZaLHfyL0rJB/a5tzUsFf2yKMEAns4byFDz/S0/W8Rb Zj1e6zShHPnxhOAvP4HcdmkKfuR2ekpQBYnvIS+cA0fOcVV5gokcO5a18MuGG9005yhr uyww== X-Gm-Message-State: AA+aEWZY0rt5Xoc0Krtcv3Jp9D0kqZjNK7MFa08Pqco/D+4pRbY/SHQI KfpId7/RrSmXbHqluwf9GMt8Rhx6 X-Google-Smtp-Source: AFSGD/XVkrGO6hVleB7rpUpKMEstgcAuGNu6J2ycjqTeFzOVrfEIREYyia3hFC9YF0P+SAZa84VSjw== X-Received: by 2002:a1c:a6d7:: with SMTP id p206mr18272157wme.143.1544093808107; Thu, 06 Dec 2018 02:56:48 -0800 (PST) Received: from localhost.localdomain ([94.250.174.60]) by smtp.gmail.com with ESMTPSA id k15sm48753wru.8.2018.12.06.02.56.47 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Dec 2018 02:56:47 -0800 (PST) From: Paul B Mahol To: ffmpeg-devel@ffmpeg.org Date: Thu, 6 Dec 2018 11:56:39 +0100 Message-Id: <20181206105640.12774-1-onemda@gmail.com> X-Mailer: git-send-email 2.17.1 Subject: [FFmpeg-devel] [PATCH 1/2] avcodec/dpx: check version of format header too 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/dpx.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c index 538a1b9943..0297287938 100644 --- a/libavcodec/dpx.c +++ b/libavcodec/dpx.c @@ -106,6 +106,7 @@ static int decode_frame(AVCodecContext *avctx, int buf_size = avpkt->size; AVFrame *const p = data; uint8_t *ptr[AV_NUM_DATA_POINTERS]; + uint32_t header_version, version = 0; unsigned int offset; int magic_num, endian; @@ -141,6 +142,15 @@ static int decode_frame(AVCodecContext *avctx, return AVERROR_INVALIDDATA; } + header_version = read32(&buf, 0); + if (header_version == MKTAG('V','1','.','0')) + version = 1; + if (header_version == MKTAG('V','2','.','0')) + version = 2; + if (!version) + av_log(avctx, AV_LOG_WARNING, "Unknown header format version %s.\n", + av_fourcc2str(header_version)); + // Check encryption buf = avpkt->data + 660; ret = read32(&buf, endian);