Fix raw data when icon position is off and uninitialized pointer
This commit is contained in:
parent
2784950f45
commit
2d562968c0
8
src/x.c
8
src/x.c
@ -320,7 +320,7 @@ static GdkPixbuf *get_pixbuf_from_path(char *icon_path)
|
|||||||
{
|
{
|
||||||
GdkPixbuf *pixbuf = NULL;
|
GdkPixbuf *pixbuf = NULL;
|
||||||
gchar *uri_path = NULL;
|
gchar *uri_path = NULL;
|
||||||
if (strlen(icon_path) > 0 && settings.icon_position != icons_off) {
|
if (strlen(icon_path) > 0) {
|
||||||
if (g_str_has_prefix(icon_path, "file://")) {
|
if (g_str_has_prefix(icon_path, "file://")) {
|
||||||
uri_path = g_filename_from_uri(icon_path, NULL, NULL);
|
uri_path = g_filename_from_uri(icon_path, NULL, NULL);
|
||||||
if (uri_path != NULL) {
|
if (uri_path != NULL) {
|
||||||
@ -365,7 +365,7 @@ static GdkPixbuf *get_pixbuf_from_path(char *icon_path)
|
|||||||
|
|
||||||
static GdkPixbuf *get_pixbuf_from_raw_image(const RawImage *raw_image)
|
static GdkPixbuf *get_pixbuf_from_raw_image(const RawImage *raw_image)
|
||||||
{
|
{
|
||||||
GdkPixbuf *pixbuf;
|
GdkPixbuf *pixbuf = NULL;
|
||||||
|
|
||||||
pixbuf = gdk_pixbuf_new_from_data(raw_image->data,
|
pixbuf = gdk_pixbuf_new_from_data(raw_image->data,
|
||||||
GDK_COLORSPACE_RGB,
|
GDK_COLORSPACE_RGB,
|
||||||
@ -394,9 +394,9 @@ static colored_layout *r_init_shared(cairo_t *c, notification *n)
|
|||||||
|
|
||||||
GdkPixbuf *pixbuf = NULL;
|
GdkPixbuf *pixbuf = NULL;
|
||||||
|
|
||||||
if (n->raw_icon) {
|
if (n->raw_icon && settings.icon_position != icons_off) {
|
||||||
pixbuf = get_pixbuf_from_raw_image(n->raw_icon);
|
pixbuf = get_pixbuf_from_raw_image(n->raw_icon);
|
||||||
} else if (n->icon) {
|
} else if (n->icon && settings.icon_position != icons_off) {
|
||||||
pixbuf = get_pixbuf_from_path(n->icon);
|
pixbuf = get_pixbuf_from_path(n->icon);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user