]> git.sesse.net Git - kdenlive/blobdiff - src/kthumb.cpp
fix BUG#3167 crash when updating video thumbs (need confirm?)
[kdenlive] / 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);