]> git.sesse.net Git - kdenlive/commitdiff
fix BUG#3167 crash when updating video thumbs (need confirm?)
authorVincent PINON <vincent.pinon@laposte.net>
Fri, 14 Feb 2014 11:51:01 +0000 (12:51 +0100)
committerVincent PINON <vincent.pinon@laposte.net>
Fri, 14 Feb 2014 11:51:01 +0000 (12:51 +0100)
src/kthumb.cpp

index 3d660b551bf18a7841c1b70560fd845b720a28a6..3bf19e2841dc28758ee9cd995818923d2c203822 100644 (file)
@@ -218,6 +218,10 @@ QImage KThumb::getFrame(Mlt::Frame *frame, int frameWidth, int displayWidth, int
     if (ow % 2 == 1) ow++;
     QImage image(ow, oh, QImage::Format_ARGB32_Premultiplied);
     const uchar* imagedata = frame->get_image(format, ow, oh);
+    if (imagedata == NULL) {
+        p.fill(QColor(Qt::red).rgb());
+        return p;
+    }
     memcpy(image.bits(), imagedata, ow * oh * 4);//.byteCount());
     
     //const uchar* imagedata = frame->get_image(format, ow, oh);