GNOME Bugzilla – Bug 756861
hlsdemux: crash / memory leak on broken (master) playlist
Last modified: 2015-10-25 10:57:43 UTC
hlsdemux: don't crash / leak memory on broken (master) playlist If a (master) playlist contains a variant list entry without a URI then during parsing of the next variant list entry we are a) leaking the entry we're currently parsing (new_list), and b) free'ing the pointer to the previous list entry (list) without updating the pointer. Hence when then adding the URI for the latest parsed entry, incorrect information is stored, as the information is used from 'list' which is not valid memory anymore, also leading to crashes. Fix this by correctly storing the new variant list entry pointer as needed.
Created attachment 313738 [details] [review] suggested fix
The same code exists in the 1.6 and 1.4 gstreamer branches.
Thanks, pushed: commit 41ca1e48a0baa53354d3c9d0dd8679fab5fcfbb3 Author: Tim-Philipp Müller <tim@centricular.com> Date: Sun Oct 25 01:19:33 2015 +0100 tests: hlsdemux_m3u: add test for master playlist with missing variant list uri https://bugzilla.gnome.org/show_bug.cgi?id=756861 commit e0b4290998d9a95553b7b6ad732891e3d1c8cc5b Author: André Draszik <git@andred.net> Date: Tue Oct 20 09:13:04 2015 +0100 hlsdemux: don't crash or leak memory on broken master playlist If a (master) playlist contains a variant list entry without a URI then during parsing of the next variant list entry we are a) leaking the entry we're currently parsing (new_list), and b) free'ing the pointer to the previous list entry (list) without updating the pointer. Hence when then adding the URI for the latest parsed entry, incorrect information is stored, as the information is used from 'list' which is not valid memory anymore, also leading to crashes. Fix this by correctly storing the new variant list entry pointer as needed. https://bugzilla.gnome.org/show_bug.cgi?id=756861