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 787058 - libpng : Fix Memory leak in gstpngenc.c
libpng : Fix Memory leak in gstpngenc.c
Status: RESOLVED DUPLICATE of bug 787885
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
1.12.2
Other All
: Normal normal
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-08-31 07:43 UTC by Satya Prakash Gupta
Modified: 2017-09-20 08:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch file is attached. (738 bytes, patch)
2017-08-31 07:43 UTC, Satya Prakash Gupta
needs-work Details | Review
Updated patch is attached. (1.29 KB, patch)
2017-09-20 08:13 UTC, Satya Prakash Gupta
none Details | Review

Description Satya Prakash Gupta 2017-08-31 07:43:17 UTC
Created attachment 358817 [details] [review]
Patch file is attached.

Hi, 

File : gst-plugins-good/ext/libpng/gstpngenc.c

Function  gst_pngenc_handle_frame  Line : 308

gst_pngenc_handle_frame

There is memory leak in gstpngenc.c file as memory is allocated just before gst_video_frame_map.

Solution : g_free (row_pointers);

++patch is attched for possible solution.

Kindly review the patch and provide your feedback.
Comment 1 Sebastian Dröge (slomo) 2017-09-11 09:26:38 UTC
Comment on attachment 358817 [details] [review]
Patch file is attached.

Just allocate the row pointers after successfully mapping the video frame
Comment 2 Satya Prakash Gupta 2017-09-20 08:13:06 UTC
Created attachment 360102 [details] [review]
Updated patch is attached.
Comment 3 Tim-Philipp Müller 2017-09-20 08:17:16 UTC
Are you guys working on the same static analyzer output but not co-ordinating by any chance?

commit c53bee067d9d7ed0f8ac010628d13f2a2081fc9b
Author: Ponnam Srinivas <p.srinivas@samsung.com>
Date:   Wed Sep 20 09:37:59 2017 +0530

    pngenc: fix memory leak in error code path
    
    Don't leak row_pointers if frame can't be mapped.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=787885

*** This bug has been marked as a duplicate of bug 787885 ***