Sophie

Sophie

distrib > Mageia > 8 > x86_64 > by-pkgid > 530e432b82b6e746a75c4c6cd1862d1e > files > 5

openexr-2.5.7-1.3.mga8.src.rpm

From 77a54ef4d0cecc3324f962ac99c084a04ead79bb Mon Sep 17 00:00:00 2001
From: Peter Hillman <peterh@wetafx.co.nz>
Date: Mon, 29 Nov 2021 17:43:32 +1300
Subject: [PATCH] enforce xSampling/ySampling==1 in CompositeDeepScanLine

Signed-off-by: Peter Hillman <peterh@wetafx.co.nz>
---
 OpenEXR/IlmImf/ImfCompositeDeepScanLine.cpp | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/OpenEXR/IlmImf/ImfCompositeDeepScanLine.cpp b/OpenEXR/IlmImf/ImfCompositeDeepScanLine.cpp
index 158a9ec9e..644cb3570 100644
--- a/OpenEXR/IlmImf/ImfCompositeDeepScanLine.cpp
+++ b/OpenEXR/IlmImf/ImfCompositeDeepScanLine.cpp
@@ -238,6 +238,20 @@ CompositeDeepScanLine::setFrameBuffer(const FrameBuffer& fr)
     
     for(FrameBuffer::ConstIterator q=fr.begin();q!=fr.end();q++)
     {
+
+        //
+        // Frame buffer must have xSampling and ySampling set to 1
+        // (Sampling in FrameBuffers must match sampling in file,
+        //  and Header::sanityCheck enforces sampling in deep files is 1)
+        //
+
+        if(q.slice().xSampling!=1 || q.slice().ySampling!=1)
+        {
+             THROW (IEX_NAMESPACE::ArgExc, "X and/or y subsampling factors "
+				"of \"" << q.name() << "\" channel in framebuffer "
+				"are not 1");
+        }
+
         string name(q.name());
         if(name=="ZBack")
         {