videofilter: Unmap input frame if mapping output frame failed
authorSatya Prakash Gupta <sp.gupta@samsung.com>
Mon, 24 Jul 2017 13:48:49 +0000 (19:18 +0530)
committerSebastian Dröge <sebastian@centricular.com>
Mon, 24 Jul 2017 14:05:17 +0000 (17:05 +0300)
https://bugzilla.gnome.org/show_bug.cgi?id=785341

gst-libs/gst/video/gstvideofilter.c

index 9fd217530f3b74bd502ce65cfb1dbbef0c80fa86..408750673e92446029dbf8b98118b59a5561b776 100644 (file)
@@ -262,9 +262,10 @@ gst_video_filter_transform (GstBaseTransform * trans, GstBuffer * inbuf,
       goto invalid_buffer;
 
     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;
-
+    }
     res = fclass->transform_frame (filter, &in_frame, &out_frame);
 
     gst_video_frame_unmap (&out_frame);