Summary: | media-video/mplayer-1.0_rc4_p20100213: memory corruption while loading .pls playlist | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Michał Mirosław <mirq-genboogs> |
Component: | Current packages | Assignee: | Gentoo Media-video project <media-video> |
Status: | RESOLVED UPSTREAM | ||
Severity: | critical | CC: | sping |
Priority: | High | Keywords: | Inclusion |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
Playlist generating the failure
Quick patch to fix this issue Bigger patch to guard against malformed .pls playlists |
Description
Michał Mirosław
2010-02-27 17:19:26 UTC
Created attachment 221451 [details]
Playlist generating the failure
Created attachment 221453 [details, diff]
Quick patch to fix this issue
Note: The patch prevents crash for invalid entries, but might not be a proper fix. Thanks for reporting, especially nice to have a trigger file.
> Note: The patch prevents crash for invalid entries, but might not be a proper
> fix.
From a quick look at
- the playlist
- the patch
- another PLS example
It seems to me that all these "length" entries should be "Length1", "Length2" and so forth and that the lack of that number is the problem. Ignore me if you already knew that :-)
There's another bug in this code anyway, as any valid file/length/whatever with some large number will cause mplayer to alloc a lot of memory or maybe even overflow the size calculations and then still corrupt memory. Created attachment 221505 [details, diff]
Bigger patch to guard against malformed .pls playlists
This patch modifies .pls parser to guard against malformed .pls entries (big/no numbers). Performance difference should be negligible for small playlists, and small for big ones but with ordered and consecutive-numbered entries.
(This patch includes a simple optimization to avoid one copy per string value parsed. I can split this out if really needed.)
Compile and run tested against attached playlist.
Was this reported upstream? Obviously it's not getting in Portage before that. http://bugzilla.mplayerhq.hu/ I assumed that package maintainer would pass it on. The patch does not apply to latest SVN snapshot - there were some related changes in upstream playtreeparser.c so this bug might actually be fixed there already (I haven't tested it yet, though). (In reply to comment #8) > I assumed that package maintainer would pass it on. In perfect world, sure. Get involved with gentoo as media-video maintainer, or get involved with mplayer upstream yourself. > The patch does not apply to latest SVN snapshot - there were some related > changes in upstream playtreeparser.c so this bug might actually be fixed there > already (I haven't tested it yet, though). Let us know, thanks! (In reply to comment #9) > (In reply to comment #8) > > The patch does not apply to latest SVN snapshot - there were some related > > changes in upstream playtreeparser.c so this bug might actually be fixed there > > already (I haven't tested it yet, though). > Let us know, thanks! SVN snapshot from 2010-04-30 doesn't crash on this playlist anymore. |