[niepce] Fix crash if thumbnail cannot be generated.



commit 65ec4989f7f4fbfe931fb3fc6ab1a665bf1dbcef
Author: Hub Figuiere <hub figuiere net>
Date:   Fri Nov 11 23:59:02 2011 -0800

    Fix crash if thumbnail cannot be generated.

 src/engine/library/thumbnailcache.cpp |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/engine/library/thumbnailcache.cpp b/src/engine/library/thumbnailcache.cpp
index 13dd665..7b6e913 100644
--- a/src/engine/library/thumbnailcache.cpp
+++ b/src/engine/library/thumbnailcache.cpp
@@ -120,9 +120,9 @@ Glib::RefPtr<Gdk::Pixbuf> getThumbnail(const LibFile::Ptr & f, int w, int h, con
                                                                    std::min(w, h));
         if(pixbuf) {
             pix = Glib::wrap(pixbuf, true); // take ownership
-        }
-        if((w < pix->get_width()) || (h < pix->get_height())) {
-            pix = fwk::gdkpixbuf_scale_to_fit(pix, std::min(w,h));
+            if((w < pix->get_width()) || (h < pix->get_height())) {
+                pix = fwk::gdkpixbuf_scale_to_fit(pix, std::min(w,h));
+            }
         }
     }
     if(pix)



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