omxvideoenc: Don't forget to unmap frame in error cases
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Fri, 11 Jan 2013 11:34:04 +0000 (12:34 +0100)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Mon, 14 Jan 2013 09:36:50 +0000 (10:36 +0100)
omx/gstomxvideoenc.c

index 32af22c..5da285a 100644 (file)
@@ -1162,6 +1162,7 @@ gst_omx_video_enc_fill_buffer (GstOMXVideoEnc * self, GstBuffer * inbuf,
 
         if (dest + dest_stride * height >
             outbuf->omx_buf->pBuffer + outbuf->omx_buf->nAllocLen) {
+          gst_video_frame_unmap (&frame);
           GST_ERROR_OBJECT (self, "Invalid output buffer size");
           ret = FALSE;
           break;
@@ -1219,6 +1220,7 @@ gst_omx_video_enc_fill_buffer (GstOMXVideoEnc * self, GstBuffer * inbuf,
 
         if (dest + dest_stride * height >
             outbuf->omx_buf->pBuffer + outbuf->omx_buf->nAllocLen) {
+          gst_video_frame_unmap (&frame);
           GST_ERROR_OBJECT (self, "Invalid output buffer size");
           ret = FALSE;
           break;