Author: post
Date: 2010-02-13 16:20:06 +0100 (Sat, 13 Feb 2010)
New Revision: 3212

Modified:
   trunk/librawstudio/rs-profile-factory.c
   trunk/librawstudio/rs-profile-selector.c
   trunk/librawstudio/rs-tiff.c
Log:
Fix (Null) being displayed as profile name because of off-by-one in TIFF bounds 
check.

Modified: trunk/librawstudio/rs-profile-factory.c
===================================================================
--- trunk/librawstudio/rs-profile-factory.c     2010-02-13 14:30:16 UTC (rev 
3211)
+++ trunk/librawstudio/rs-profile-factory.c     2010-02-13 15:20:06 UTC (rev 
3212)
@@ -62,7 +62,6 @@
        if (model)
        {
                GtkTreeIter iter;
-
                gtk_list_store_prepend(factory->profiles, &iter);
                gtk_list_store_set(factory->profiles, &iter,
                        FACTORY_MODEL_COLUMN_TYPE, FACTORY_MODEL_TYPE_DCP,
@@ -186,7 +185,7 @@
 static gboolean
 visible_func(GtkTreeModel *model, GtkTreeIter *iter, gpointer data)
 {
-       gboolean visible = TRUE;
+       gboolean visible = FALSE;
 
        gchar *model_needle = (gchar *) data;
        gchar *model_haystack;
@@ -199,9 +198,12 @@
 
        /* The only thing we need to hide is mismatched DCP profiles */
        if (model_needle && model_haystack)
-               if ((type == FACTORY_MODEL_TYPE_DCP) && 
(g_ascii_strcasecmp(model_needle, model_haystack) != 0))
-               visible = FALSE;
+               if ((type == FACTORY_MODEL_TYPE_DCP) && 
(g_ascii_strcasecmp(model_needle, model_haystack) == 0))
+               visible = TRUE;
 
+       if (type != FACTORY_MODEL_TYPE_DCP)
+               visible = TRUE;
+
        return visible;
 }
 

Modified: trunk/librawstudio/rs-profile-selector.c
===================================================================
--- trunk/librawstudio/rs-profile-selector.c    2010-02-13 14:30:16 UTC (rev 
3211)
+++ trunk/librawstudio/rs-profile-selector.c    2010-02-13 15:20:06 UTC (rev 
3212)
@@ -178,6 +178,7 @@
        gint type;
        gpointer profile;
        gchar *str;
+       const gchar *profile_name;
 
        g_object_get(filter, "child-model", &model, NULL);
        
gtk_tree_model_filter_convert_iter_to_child_iter(GTK_TREE_MODEL_FILTER(filter), 
&child_iter, iter);
@@ -195,7 +196,8 @@
                switch(type)
                {
                        case FACTORY_MODEL_TYPE_DCP:
-                               str = g_strdup_printf("%s 
<small><small>(dcp)</small></small>", rs_dcp_file_get_name(profile));
+                               profile_name = rs_dcp_file_get_name(profile);
+                               str = g_strdup_printf("%s 
<small><small>(dcp)</small></small>", profile_name);
                                g_value_set_string(value, str);
                                g_free(str);
                                break;

Modified: trunk/librawstudio/rs-tiff.c
===================================================================
--- trunk/librawstudio/rs-tiff.c        2010-02-13 14:30:16 UTC (rev 3211)
+++ trunk/librawstudio/rs-tiff.c        2010-02-13 15:20:06 UTC (rev 3212)
@@ -189,7 +189,7 @@
        entry = rs_tiff_get_ifd_entry(tiff, ifd_num, tag);
        if (entry && entry->type && entry->count)
        {
-               if ((entry->value_offset + entry->count) < tiff->map_length)
+               if ((entry->value_offset + entry->count) <= tiff->map_length)
                        ret = g_strndup((gchar *) tiff->map + 
entry->value_offset , entry->count);
        }
 


_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit

Reply via email to