diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/imageutils.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/imageutils.cc b/src/imageutils.cc index 133eaf1..08b0492 100644 --- a/src/imageutils.cc +++ b/src/imageutils.cc @@ -1,9 +1,11 @@ #include "imageutils.h" #include <string.h> #include <fstream> +#include <assert> void flip_image(const unsigned char *src, unsigned char *dst, size_t pixelsize, size_t width, size_t height) { + assert( src && dst ); size_t rowBytes = pixelsize * width; for (size_t i = 0 ; i < height ; i++) { memmove(dst + (height - i - 1) * rowBytes, src + i * rowBytes, rowBytes); @@ -11,6 +13,7 @@ void flip_image(const unsigned char *src, unsigned char *dst, size_t pixelsize, } bool write_png(const char *filename, unsigned char *pixels, int width, int height) { + assert( filename && pixels ); std::ofstream fstream( filename, std::ios::binary ); if (fstream.is_open()) { write_png( fstream, pixels, width, height ); |