From patchwork Tue Sep 27 23:49:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 762 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.66 with SMTP id o63csp131144vsd; Tue, 27 Sep 2016 16:50:11 -0700 (PDT) X-Received: by 10.194.73.5 with SMTP id h5mr3316048wjv.217.1475020211849; Tue, 27 Sep 2016 16:50:11 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id wo3si5229851wjb.254.2016.09.27.16.50.09; Tue, 27 Sep 2016 16:50:11 -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; dkim=neutral (body hash did not verify) header.i=@gmail.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; dmarc=fail (p=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1A6FF689F9D; Wed, 28 Sep 2016 02:49:48 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-oi0-f68.google.com (mail-oi0-f68.google.com [209.85.218.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5BB65689F8D for ; Wed, 28 Sep 2016 02:49:41 +0300 (EEST) Received: by mail-oi0-f68.google.com with SMTP id n202so1861667oig.2 for ; Tue, 27 Sep 2016 16:49:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references; bh=mUFdcXLs9xs2A749d3VVIEZRgMDe1xXeYBv95PBO07g=; b=vz5zqLzl3/0xaetGTGyGA2fjJdPKwSMbYXF/405z4OYlr2YB7HoCGIqeXrNwIfwq5x pD4zWSPwrkGJYUKP7ZC2Tjp8tnLZjn2nsj4oJTUVuCP7RsoG4Xvupy16rstNWXFnHz9m sNulmZBGuhcAmPuyqlML7O8trxdzfyJ3U3c0a7TJcIXDlfsXz+45WRPoDl/amERHhTMu lPTKQ21YlDPr9vZolyE6Z+p+lTY7nuOs7CQNz2PH1ZqUsgaTN7xdCnExLdfxlTtD3681 AYjvXxyGZ9lMAzK+G2eDt6maD0JKeVxxTdnyYgAf6Tpsr+F7EEOEQS2i3z5NiXYhHzO0 J8BQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=mUFdcXLs9xs2A749d3VVIEZRgMDe1xXeYBv95PBO07g=; b=QQkilJlwUbyGLf34vy4NRrqQhdzZxNTnX0jeSAMSYtgE1d2yxocXBq1YTUXrcmoVgi KXfEsqUR6lwv4EbjY6g60mtYHzgvmKyx3F4m9D4y2WEG9CuIq36h2HB7hVrGczG9LUbn s8aDgoQFHbKa7AhlPJJ41Z2D7G2WXU3IqpY0a9+fHQXqZ8BbSlbFnmSZePavY9PiD0sF lzWGKuFt0YiWP0OGPns1JUhjijAsIqW+fzrcAKVuSCKMMUQdkL4Wxux1kNop9I7v7ZNq nRWX2LKdkZKAuXE1bJn9glta7+NtqtCeAAKCaNFwvOoNNKa6p/xEHhJS4J4yrWXx+4Ul n34w== X-Gm-Message-State: AA6/9RkrpBvHu3aXfhwQ9Lc60zyCa4YoUufe2S+Dnm1b5XGeLUgSS0fn1b6pYB8x4/CZ3Q== X-Received: by 10.157.2.201 with SMTP id 67mr754825otl.40.1475020192060; Tue, 27 Sep 2016 16:49:52 -0700 (PDT) Received: from localhost.localdomain ([181.22.0.151]) by smtp.gmail.com with ESMTPSA id w78sm1449038oiw.17.2016.09.27.16.49.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 27 Sep 2016 16:49:51 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Tue, 27 Sep 2016 20:49:03 -0300 Message-Id: <20160927234903.4184-2-jamrial@gmail.com> X-Mailer: git-send-email 2.9.1 In-Reply-To: <20160927234903.4184-1-jamrial@gmail.com> References: <20160927234903.4184-1-jamrial@gmail.com> Subject: [FFmpeg-devel] [PATCH 2/2] avformat/matroskadec: check for more reserved values on some Colour elements 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: James Almer --- libavformat/matroskadec.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 32b2457..a94398b 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -1810,9 +1810,11 @@ static int mkv_parse_video_color(AVStream *st, const MatroskaTrack *track) { if (track->video.color.matrix_coefficients != AVCOL_SPC_RESERVED) st->codecpar->color_space = track->video.color.matrix_coefficients; - if (track->video.color.primaries != AVCOL_PRI_RESERVED) + if (track->video.color.primaries != AVCOL_PRI_RESERVED && + track->video.color.primaries != AVCOL_PRI_RESERVED0) st->codecpar->color_primaries = track->video.color.primaries; - if (track->video.color.transfer_characteristics != AVCOL_TRC_RESERVED) + if (track->video.color.transfer_characteristics != AVCOL_TRC_RESERVED && + track->video.color.transfer_characteristics != AVCOL_TRC_RESERVED0) st->codecpar->color_trc = track->video.color.transfer_characteristics; if (track->video.color.range != AVCOL_RANGE_UNSPECIFIED && track->video.color.range <= AVCOL_RANGE_JPEG)