From e3ea4e9a94f2768e411490e4fc5234bdcf80bdc7 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Mon, 23 Aug 2010 12:14:31 +0200 Subject: [PATCH] Bitmap: int->size_t --- include/mitsuba/core/bitmap.h | 2 +- src/libcore/bitmap.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/mitsuba/core/bitmap.h b/include/mitsuba/core/bitmap.h index abb8183a..dfa402b1 100644 --- a/include/mitsuba/core/bitmap.h +++ b/include/mitsuba/core/bitmap.h @@ -120,7 +120,7 @@ protected: int m_width; int m_height; int m_bpp; - int m_size; + size_t m_size; unsigned char *m_data; std::string m_title; std::string m_author; diff --git a/src/libcore/bitmap.cpp b/src/libcore/bitmap.cpp index 425bd2b5..f1a6c0db 100644 --- a/src/libcore/bitmap.cpp +++ b/src/libcore/bitmap.cpp @@ -146,7 +146,7 @@ Bitmap::Bitmap(int width, int height, int bpp) m_gamma = -1.0f; // sRGB // 1-bit masks are stored in a packed format. - m_size = (int) std::ceil((m_width * m_height * m_bpp) / 8.0f); + m_size = (size_t) std::ceil((m_width * m_height * m_bpp) / 8.0f); m_data = static_cast(allocAligned(m_size)); } @@ -309,7 +309,7 @@ void Bitmap::loadPNG(Stream *stream) { &colortype, &interlacetype, &compressiontype, &filtertype); m_width = width; m_height = height; - m_size = (int) std::ceil((m_width * m_height * m_bpp) / 8.0f); + m_size = (size_t) std::ceil((m_width * m_height * m_bpp) / 8.0f); m_data = static_cast(allocAligned(m_size)); rows = new png_bytep[m_height];