[dia] [scan-build] Dereference of null pointer
- From: Hans Breuer <hans src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dia] [scan-build] Dereference of null pointer
- Date: Wed, 1 Jan 2014 16:31:10 +0000 (UTC)
commit aa234606168e97e944504ff5261a9d1cef9d77b7
Author: Hans Breuer <hans breuer org>
Date: Fri Oct 4 16:35:01 2013 +0200
[scan-build] Dereference of null pointer
dia_image.c:413:32: warning: Access to field 'image' results in a
dereference of a null pointer (loaded from variable 'image')
if (gdk_pixbuf_get_has_alpha(image->image)) {
lib/dia_image.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/lib/dia_image.c b/lib/dia_image.c
index 681ed2e..6bbb9a4 100644
--- a/lib/dia_image.c
+++ b/lib/dia_image.c
@@ -410,6 +410,7 @@ dia_image_rgb_data(const DiaImage *image)
if (!rgb_pixels)
return NULL;
+ g_return_val_if_fail (image != NULL, NULL);
if (gdk_pixbuf_get_has_alpha(image->image)) {
guint8 *pixels = gdk_pixbuf_get_pixels(image->image);
int i, j;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]