[babl] bail on db-cache restoration if format lookup fails



commit 5f322b3222bf936091b0677686574a5729d5b658
Author: Øyvind Kolås <pippin gimp org>
Date:   Mon Nov 14 02:30:03 2016 +0100

    bail on db-cache restoration if format lookup fails

 babl/babl.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/babl/babl.c b/babl/babl.c
index 1287383..72f2327 100644
--- a/babl/babl.c
+++ b/babl/babl.c
@@ -350,9 +350,17 @@ static void babl_init_db (const char *path)
           break;
         default:
           if (!from_format)
-            from_format = babl_format (token);
+          {
+            from_format = (void*)babl_db_find(babl_format_db(), &token[1]);
+            if (!from_format)
+              return;
+          }
           else
-            to_format = babl_format (token);
+          {
+            to_format = (void*)babl_db_find(babl_format_db(), &token[1]);
+            if (!to_format)
+              return;
+          }
 
           break;
       }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]