deinterlace: Instead of confusing crashes later, just error out immediately if mappin...
authorSebastian Dröge <sebastian@centricular.com>
Tue, 12 Apr 2016 12:00:31 +0000 (15:00 +0300)
committerSebastian Dröge <sebastian@centricular.com>
Tue, 12 Apr 2016 12:00:31 +0000 (15:00 +0300)
This probably still crashes but at least we get some hint about what goes
wrong instead of random behaviour later.

gst/deinterlace/gstdeinterlace.c

index 987c4ed..e4e1654 100644 (file)
@@ -744,7 +744,11 @@ gst_video_frame_new_and_map (GstVideoInfo * vinfo, GstBuffer * buffer,
     GstMapFlags flags)
 {
   GstVideoFrame *frame = g_malloc0 (sizeof (GstVideoFrame));
-  gst_video_frame_map (frame, vinfo, buffer, flags);
+  if (!gst_video_frame_map (frame, vinfo, buffer, flags)) {
+    g_free (frame);
+    g_return_val_if_reached (NULL);
+    return NULL;
+  }
   return frame;
 }