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.
This commit is contained in:
Sebastian Dröge 2016-04-12 15:00:31 +03:00
parent 1bb9d9c682
commit 0c84b1b104

View 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;
}