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

Tomasz Wasilczyk <[email protected]>
Newsgroups gmane.comp.gnome.gaim.cvs
Message-ID <[email protected]>
Changeset: 75cbabcd0a4d8d0b521cf66a917064f3d4c33b76
Author:	 Tomasz Wasilczyk <[email protected]>
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) {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.