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:
parent
1bb9d9c682
commit
0c84b1b104
@ -744,7 +744,11 @@ gst_video_frame_new_and_map (GstVideoInfo * vinfo, GstBuffer * buffer,
|
|||||||
GstMapFlags flags)
|
GstMapFlags flags)
|
||||||
{
|
{
|
||||||
GstVideoFrame *frame = g_malloc0 (sizeof (GstVideoFrame));
|
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;
|
return frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user