From 2be605933f62521bb22780256386a14b371c8b17 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Thu, 9 Aug 2012 22:16:30 +0300 Subject: [PATCH] Fix 3D texture loading with fixed depth --- source/texture3d.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/texture3d.cpp b/source/texture3d.cpp index 4aac49ed..30363acc 100644 --- a/source/texture3d.cpp +++ b/source/texture3d.cpp @@ -99,7 +99,14 @@ void Texture3D::load_image(const string &fn, int dp) h = d; } else if(dp>0) + { d = dp; + if(h%d) + throw incompatible_data("Texture3D::load_image"); + h /= d; + } + else + throw invalid_argument("Texture3D::load_image"); PixelFormat fmt = pixelformat_from_graphics(img.get_format()); if(width==0) -- 2.45.2