[shotwell] Check for failure to render video thumbnail: Bug #738245
- From: Jim Nelson <jnelson src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [shotwell] Check for failure to render video thumbnail: Bug #738245
- Date: Fri, 24 Oct 2014 20:45:18 +0000 (UTC)
commit 2ae25e17ca131e848ae708a1c01ff68e7167ee5a
Author: Jim Nelson <jim yorba org>
Date: Fri Oct 24 13:43:36 2014 -0700
Check for failure to render video thumbnail: Bug #738245
As part of a user reporting problems, their trace indicated that
the GStreamer buffer holding the video thumbnail can sometimes come
back null. shotwell-video-thumbnailer wasn't checking for this
possibility.
thumbnailer/shotwell-video-thumbnailer.vala | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/thumbnailer/shotwell-video-thumbnailer.vala b/thumbnailer/shotwell-video-thumbnailer.vala
index 5b8b89a..93db2aa 100644
--- a/thumbnailer/shotwell-video-thumbnailer.vala
+++ b/thumbnailer/shotwell-video-thumbnailer.vala
@@ -104,7 +104,12 @@ class ShotwellThumbnailer {
buffer = sample.get_buffer();
buffer.map(out mapinfo, Gst.MapFlags.READ);
-
+
+ if (mapinfo.data == null || mapinfo.data.length == 0) {
+ stderr.printf("Could not get snapshot data buffer\n");
+ return 7;
+ }
+
// Create pixmap from buffer and save, gstreamer video buffers have a stride
// that is rounded up to the nearest multiple of 4.
pixbuf = new Gdk.Pixbuf.from_data(mapinfo.data, Gdk.Colorspace.RGB, false, 8,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]