X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftexture3d.cpp;h=30363acc3d8046ff10fd73f9b6271bce4c353b4c;hb=2be605933f62521bb22780256386a14b371c8b17;hp=4aac49edfaf82f27eaf4c3eef8c7021596d5033e;hpb=70153a4e27eeebc7e0a91de122f45eff6296cb71;p=libs%2Fgl.git 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)