From: Mikko Rasa Date: Thu, 9 Aug 2012 19:16:30 +0000 (+0300) Subject: Fix 3D texture loading with fixed depth X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=commitdiff_plain;h=2be605933f62521bb22780256386a14b371c8b17 Fix 3D texture loading with fixed depth --- 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)