/pidgin/main: 75cbabcd0a4d: Check parameters for pidgin_pixbuf_n...

Tomasz Wasilczyk twasilczyk at pidgin.im
Tue May 13 07:23:51 EDT 2014


Changeset: 75cbabcd0a4d8d0b521cf66a917064f3d4c33b76
Author:	 Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date:	 2014-05-13 13:23 +0200
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/75cbabcd0a4d

Description:

Check parameters for pidgin_pixbuf_new_from_file* functions

diffstat:

 pidgin/gtkutils.c |  9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diffs (33 lines):

diff --git a/pidgin/gtkutils.c b/pidgin/gtkutils.c
--- a/pidgin/gtkutils.c
+++ b/pidgin/gtkutils.c
@@ -3086,6 +3086,9 @@ GdkPixbuf *pidgin_pixbuf_new_from_file(c
 	GdkPixbuf *pixbuf;
 	GError *error = NULL;
 
+	g_return_val_if_fail(filename != NULL, NULL);
+	g_return_val_if_fail(filename[0] != '\0', NULL);
+
 	pixbuf = gdk_pixbuf_new_from_file(filename, &error);
 	if (!pixbuf || error) {
 		purple_debug_warning("gtkutils", "gdk_pixbuf_new_from_file() "
@@ -3108,6 +3111,9 @@ GdkPixbuf *pidgin_pixbuf_new_from_file_a
 	GdkPixbuf *pixbuf;
 	GError *error = NULL;
 
+	g_return_val_if_fail(filename != NULL, NULL);
+	g_return_val_if_fail(filename[0] != '\0', NULL);
+
 	pixbuf = gdk_pixbuf_new_from_file_at_size(filename,
 			width, height, &error);
 	if (!pixbuf || error) {
@@ -3131,6 +3137,9 @@ GdkPixbuf *pidgin_pixbuf_new_from_file_a
 	GdkPixbuf *pixbuf;
 	GError *error = NULL;
 
+	g_return_val_if_fail(filename != NULL, NULL);
+	g_return_val_if_fail(filename[0] != '\0', NULL);
+
 	pixbuf = gdk_pixbuf_new_from_file_at_scale(filename,
 			width, height, preserve_aspect_ratio, &error);
 	if (!pixbuf || error) {



More information about the Commits mailing list