summaryrefslogtreecommitdiff
path: root/gst/deinterlace
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2016-04-12 15:00:31 +0300
committerSebastian Dröge <sebastian@centricular.com>2016-04-12 15:00:31 +0300
commit0c84b1b10430406975ec401f88a40edfb942f854 (patch)
treed9c2f07fb39744f627b5b64561ab3632e724d9dd /gst/deinterlace
parent1bb9d9c6829c42fb61c881165483ffef08420a9f (diff)
deinterlace: Instead of confusing crashes later, just error out immediately if mapping a video frame fails
This probably still crashes but at least we get some hint about what goes wrong instead of random behaviour later.
Diffstat (limited to 'gst/deinterlace')
-rw-r--r--gst/deinterlace/gstdeinterlace.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gst/deinterlace/gstdeinterlace.c b/gst/deinterlace/gstdeinterlace.c
index 987c4eda8..e4e16542f 100644
--- a/gst/deinterlace/gstdeinterlace.c
+++ b/gst/deinterlace/gstdeinterlace.c
@@ -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;
}