Merge branch 'upstream/1.16' into tizen_gst_1.16.2
[platform/upstream/gst-plugins-base.git] / gst-libs / gst / video / gstvideofilter.c
index 23ffdd8..05961e8 100644 (file)
@@ -128,6 +128,9 @@ gst_video_filter_decide_allocation (GstBaseTransform * trans, GstQuery * query)
   if (gst_query_get_n_allocation_pools (query) > 0) {
     gst_query_parse_nth_allocation_pool (query, 0, &pool, &size, &min, &max);
 
+    if (!pool)
+      gst_query_parse_allocation (query, &outcaps, NULL);
+
     update_pool = TRUE;
   } else {
     GstVideoInfo vinfo;
@@ -269,12 +272,16 @@ gst_video_filter_transform (GstBaseTransform * trans, GstBuffer * inbuf,
       out_map_flags |= GST_VIDEO_FRAME_MAP_FLAG_NO_REF;
 
     if (!gst_video_frame_map (&out_frame, &filter->out_info, outbuf,
-            out_map_flags))
+            out_map_flags)) {
+      gst_video_frame_unmap (&in_frame);
       goto invalid_buffer;
+       }
 #else
     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;
+    }
 #endif
     res = fclass->transform_frame (filter, &in_frame, &out_frame);