After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 788243 - nvbaseenc: fix unmap video frame in failed case
nvbaseenc: fix unmap video frame in failed case
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
1.13.x
Other All
: Normal normal
: 1.13.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-09-27 14:11 UTC by Ponnam Srinivas
Modified: 2017-10-13 15:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch file attached (814 bytes, patch)
2017-09-27 14:11 UTC, Ponnam Srinivas
none Details | Review
attached patch (814 bytes, patch)
2017-09-28 09:41 UTC, Ponnam Srinivas
none Details | Review
patch file attached (1.32 KB, patch)
2017-10-07 09:32 UTC, Ponnam Srinivas
committed Details | Review

Description Ponnam Srinivas 2017-09-27 14:11:18 UTC
Created attachment 360537 [details] [review]
patch file attached

Hi ,

In gst_nv_base_enc_handle_frame(), unmap video frame is missed in error case.

code:

 flow = _acquire_input_buffer (nvenc, &input_buffer);
  if (flow != GST_FLOW_OK)
    return flow;
  if (input_buffer == NULL)
    return GST_FLOW_ERROR;


sol:

called goto out and goto error in failed case. This will unmap video frame .

 if (flow != GST_FLOW_OK)
    goto out;
  if (input_buffer == NULL)
    goto error;

Please review and share feedback.
Comment 1 Ponnam Srinivas 2017-09-28 09:41:28 UTC
Created attachment 360584 [details] [review]
attached patch

Pathc attached . Please review
Comment 2 Sebastian Dröge (slomo) 2017-09-28 10:04:50 UTC
Comment on attachment 360537 [details] [review]
patch file attached

And please mark old patches as obsolete when you attach new ones :)
Comment 3 Sebastian Dröge (slomo) 2017-09-28 10:32:39 UTC
Comment on attachment 360584 [details] [review]
attached patch

It looks like more leaks are hiding in the code below there. state and input_buffer are leaked in the "goto error" cases below, frame if we don't go into the "if (nvenc->gl_input)" and not in the "if (!nvenc->gl_input)" case.

Please review the code in this function again :)
Comment 4 Ponnam Srinivas 2017-09-28 10:39:49 UTC
sure . I will check and update the patch soon
Comment 5 Ponnam Srinivas 2017-10-07 09:32:12 UTC
Created attachment 361091 [details] [review]
patch file attached

Patch attached. Please review
Comment 6 Ponnam Srinivas 2017-10-10 08:16:41 UTC
Patch attached. Please review and share feedback
Comment 7 Ponnam Srinivas 2017-10-13 05:44:20 UTC
Patch attached. Please review and share feedback
Comment 8 Sebastian Dröge (slomo) 2017-10-13 15:29:38 UTC
Comment on attachment 361091 [details] [review]
patch file attached

Please mark your patches as patches (or use git-bz)
Comment 9 Sebastian Dröge (slomo) 2017-10-13 15:44:01 UTC
commit 53ea2f82ae4160cd53449272121dc9de31df45f8 (HEAD -> master)
Author: Ponnam Srinivas <p.srinivas@samsung.com>
Date:   Sat Oct 7 14:57:44 2017 +0530

    nvbaseenc: Fix Memory leak in error case
    
    https://bugzilla.gnome.org/show_bug.cgi?id=788243