From 698a284da8d6fc04b438e1c24b3c50100c6ab520 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 13 Sep 2011 09:46:22 +0000 Subject: [PATCH] From Sukender, "I added a tiny check to avoid an integer divide-by-zero, when image is invalid (ie. all values are 0)." --- src/osg/Image.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osg/Image.cpp b/src/osg/Image.cpp index a6fa94c5a..88f87c7b5 100644 --- a/src/osg/Image.cpp +++ b/src/osg/Image.cpp @@ -514,7 +514,7 @@ unsigned int Image::computeRowWidthInBytes(int width,GLenum pixelFormat,GLenum t { unsigned int pixelSize = computePixelSizeInBits(pixelFormat,type); int widthInBits = width*pixelSize; - int packingInBits = packing*8; + int packingInBits = packing!=0 ? packing*8 : 8; //OSG_INFO << "width="<