diff options
author | Stéphane Cerveau <scerveau@collabora.com> | 2020-04-07 19:59:12 +0200 |
---|---|---|
committer | Stéphane Cerveau <scerveau@collabora.com> | 2020-04-08 16:54:24 +0200 |
commit | 84e99060760ee0d9b1e02d2bd98f333428102fdb (patch) | |
tree | 50acbd1a90a5d1474c3d92bedd62a0b9e548eb01 /omx/gstomxvideoenc.c | |
parent | 7d5175a80f55cee98f8d0dee40b2db2601e4b138 (diff) | |
download | gst-omx-84e99060760ee0d9b1e02d2bd98f333428102fdb.tar.gz |
omxh26xenc: fix coverity with frame test
Coverity was complaining with:
Null pointer dereferences (REVERSE_INULL) Null-checking "frame"
suggests that it may be null, but it has already been
dereferenced on all paths leading to the check.
The frame == NULL has been removed as 'frame' is actively used
in the code above without any change of dereferencing and setting
its value to NULL before the test.
CID: 1461287
Diffstat (limited to 'omx/gstomxvideoenc.c')
-rw-r--r-- | omx/gstomxvideoenc.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/omx/gstomxvideoenc.c b/omx/gstomxvideoenc.c index 42a8db4..5da6085 100644 --- a/omx/gstomxvideoenc.c +++ b/omx/gstomxvideoenc.c @@ -1707,7 +1707,15 @@ gst_omx_video_enc_loop (GstOMXVideoEnc * self) gst_video_encoder_get_frames (GST_VIDEO_ENCODER (self))); g_assert (klass->handle_output_frame); - flow_ret = klass->handle_output_frame (self, self->enc_out_port, buf, frame); + + if (frame) + flow_ret = + klass->handle_output_frame (self, self->enc_out_port, buf, frame); + else { + gst_omx_port_release_buffer (self->enc_out_port, buf); + goto flow_error; + } + GST_DEBUG_OBJECT (self, "Finished frame: %s", gst_flow_get_name (flow_ret)); |