summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@users.sourceforge.net>2015-02-01 13:40:05 +0100
committerTomas Bzatek <tbzatek@users.sourceforge.net>2015-02-01 13:40:05 +0100
commit97919e37642b851af85c37f751284fd62bd74019 (patch)
tree1a3a84bab8302d7d5e3b1f4c76c07b7544b91f45
parent582702a4903a718c7d3ca5a153afef3f3006c9f0 (diff)
downloadcataract-97919e37642b851af85c37f751284fd62bd74019.tar.xz
jpeg-utils: Add some asserts
Users are not really supposed to hit any of them, it would indicate a programmer mistake otherwise.
-rw-r--r--src/jpeg-utils.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/jpeg-utils.cpp b/src/jpeg-utils.cpp
index e714778..826b112 100644
--- a/src/jpeg-utils.cpp
+++ b/src/jpeg-utils.cpp
@@ -94,6 +94,7 @@ read_exif (const gchar *filename)
{
ExifData *data;
+ g_assert (filename != NULL);
data = exif_data_new_empty ();
try {
@@ -463,6 +464,9 @@ resize_image (const gchar *src, const gchar *dst,
double source_aspect, target_aspect;
gchar *description;
+ g_assert (src != NULL);
+ g_assert (dst != NULL);
+
/* Read an image. */
magick_wand = NewMagickWand();
if (MagickReadImage (magick_wand, src) == MagickFalse) {
@@ -563,6 +567,8 @@ get_image_sizes (const gchar *img,
*width = -1;
*height = -1;
+ g_assert (img != NULL);
+
/* Read an image. */
magick_wand = NewMagickWand();
if (autorotate)
@@ -726,6 +732,8 @@ modify_exif (const gchar *filename, ExifData *exif, gboolean strip_thumbnail, gb
gboolean modified;
gboolean res;
+ g_assert (filename != NULL);
+
if (! strip_thumbnail && exif == NULL)
return;