webpenc: Unmap video frame in failed case

https://bugzilla.gnome.org/show_bug.cgi?id=787985
This commit is contained in:
Ponnam Srinivas 2017-09-21 18:13:19 +05:30 committed by Tim-Philipp Müller
parent 9d5d9897e5
commit d99cef0b40

View file

@ -292,6 +292,7 @@ gst_webp_enc_handle_frame (GstVideoEncoder * encoder,
out_buffer = gst_buffer_new_allocate (NULL, enc->webp_writer.size, NULL);
if (!out_buffer) {
GST_ERROR_OBJECT (enc, "Failed to create output buffer");
gst_video_frame_unmap (&vframe);
return GST_FLOW_ERROR;
}
gst_buffer_fill (out_buffer, 0, enc->webp_writer.mem,
@ -299,6 +300,7 @@ gst_webp_enc_handle_frame (GstVideoEncoder * encoder,
free (enc->webp_writer.mem);
} else {
GST_ERROR_OBJECT (enc, "Failed to encode WebPPicture");
gst_video_frame_unmap (&vframe);
return GST_FLOW_ERROR;
}