videofilter: Unmap input frame if mapping output frame failed

https://bugzilla.gnome.org/show_bug.cgi?id=785341
This commit is contained in:
Satya Prakash Gupta 2017-07-24 19:18:49 +05:30 committed by Sebastian Dröge
parent ae8d0cf3ac
commit 5cf883c8ed

View file

@ -262,9 +262,10 @@ gst_video_filter_transform (GstBaseTransform * trans, GstBuffer * inbuf,
goto invalid_buffer; goto invalid_buffer;
if (!gst_video_frame_map (&out_frame, &filter->out_info, outbuf, if (!gst_video_frame_map (&out_frame, &filter->out_info, outbuf,
GST_MAP_WRITE | GST_VIDEO_FRAME_MAP_FLAG_NO_REF)) GST_MAP_WRITE | GST_VIDEO_FRAME_MAP_FLAG_NO_REF)) {
gst_video_frame_unmap (&in_frame);
goto invalid_buffer; goto invalid_buffer;
}
res = fclass->transform_frame (filter, &in_frame, &out_frame); res = fclass->transform_frame (filter, &in_frame, &out_frame);
gst_video_frame_unmap (&out_frame); gst_video_frame_unmap (&out_frame);