[gthumb] gstreamer: use the data only if no error occurred



commit f71daf76297c80dede5bfddc5571b3d869a1376a
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Mon Oct 23 12:46:48 2017 +0200

    gstreamer: use the data only if no error occurred

 extensions/gstreamer_utils/gstreamer-utils.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/extensions/gstreamer_utils/gstreamer-utils.c b/extensions/gstreamer_utils/gstreamer-utils.c
index 9ede596..cf1ce49 100644
--- a/extensions/gstreamer_utils/gstreamer-utils.c
+++ b/extensions/gstreamer_utils/gstreamer-utils.c
@@ -730,16 +730,16 @@ _gst_playbin_get_current_frame (GstElement          *playbin,
                GstMapInfo  info;
 
                memory = gst_buffer_get_memory (gst_sample_get_buffer (sample), 0);
-               gst_memory_map (memory, &info, GST_MAP_READ);
-               data->pixbuf = gdk_pixbuf_new_from_data (info.data,
-                                                        GDK_COLORSPACE_RGB,
-                                                        FALSE,
-                                                        8,
-                                                        outwidth,
-                                                        outheight,
-                                                        GST_ROUND_UP_4 (outwidth * 3),
-                                                        destroy_pixbuf,
-                                                        sample);
+               if (gst_memory_map (memory, &info, GST_MAP_READ))
+                       data->pixbuf = gdk_pixbuf_new_from_data (info.data,
+                                                                GDK_COLORSPACE_RGB,
+                                                                FALSE,
+                                                                8,
+                                                                outwidth,
+                                                                outheight,
+                                                                GST_ROUND_UP_4 (outwidth * 3),
+                                                                destroy_pixbuf,
+                                                                sample);
 
                gst_memory_unmap (memory, &info);
        }


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