summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2018-01-03 16:07:18 +0100
committerTim-Philipp Müller <tim@centricular.com>2018-01-07 14:20:56 +0000
commit5fa96cab7bf92d6840ab1c69824a94009acec2fc (patch)
tree014028a5e499bc80a4c763c3e68e8aca16b8f89b
parent19be4a054681a4fbf8416e87e4c78665dd2727cc (diff)
downloadgst-omx-5fa96cab7bf92d6840ab1c69824a94009acec2fc.tar.gz
omxvideoenc: early return in fill_buffer() if something goes wrong
If something goes wrong while trying to manually copy the input buffer, the 'break' was moving us out of the 'for' loop but not out of the switch block. So we ended up calling gst_video_frame_unmap() a second time (raising assertions) and returning TRUE rather than FALSE. Reproduced with a WIP zynqultrascaleplus OMX branch reporting wrong buffer sizes and so triggering this bug. https://bugzilla.gnome.org/show_bug.cgi?id=792167
-rw-r--r--omx/gstomxvideoenc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/omx/gstomxvideoenc.c b/omx/gstomxvideoenc.c
index ce3d55a..89d0871 100644
--- a/omx/gstomxvideoenc.c
+++ b/omx/gstomxvideoenc.c
@@ -1579,7 +1579,7 @@ gst_omx_video_enc_fill_buffer (GstOMXVideoEnc * self, GstBuffer * inbuf,
if (!gst_video_frame_map (&frame, info, inbuf, GST_MAP_READ)) {
GST_ERROR_OBJECT (self, "Invalid input buffer size");
ret = FALSE;
- break;
+ goto done;
}
for (i = 0; i < 3; i++) {
@@ -1615,7 +1615,7 @@ gst_omx_video_enc_fill_buffer (GstOMXVideoEnc * self, GstBuffer * inbuf,
gst_video_frame_unmap (&frame);
GST_ERROR_OBJECT (self, "Invalid output buffer size");
ret = FALSE;
- break;
+ goto done;
}
for (j = 0; j < height; j++) {
@@ -1645,7 +1645,7 @@ gst_omx_video_enc_fill_buffer (GstOMXVideoEnc * self, GstBuffer * inbuf,
if (!gst_video_frame_map (&frame, info, inbuf, GST_MAP_READ)) {
GST_ERROR_OBJECT (self, "Invalid input buffer size");
ret = FALSE;
- break;
+ goto done;
}
dest_stride = port_def->format.video.nStride;
@@ -1674,7 +1674,7 @@ gst_omx_video_enc_fill_buffer (GstOMXVideoEnc * self, GstBuffer * inbuf,
gst_video_frame_unmap (&frame);
GST_ERROR_OBJECT (self, "Invalid output buffer size");
ret = FALSE;
- break;
+ goto done;
}
for (j = 0; j < height; j++) {