Summary: | buffer smaller than AVCODEC_MAX_AUDIO_FRAME_SIZE | ||
---|---|---|---|
Product: | [Applications] k3b | Reporter: | michel munnix <michel.munnix> |
Component: | general | Assignee: | Sebastian Trueg <trueg> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | jabouzane, kimrhh, michalm, steffen.sobiech |
Priority: | NOR | ||
Version: | 1.91.0 | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: |
test audio file
plugin configuration Fix for this bug Updated patch that applies cleanly at head Updated patch in svn diff format |
Description
michel munnix
2009-01-31 16:05:35 UTC
Created attachment 30783 [details]
test audio file
Created attachment 30784 [details]
plugin configuration
I can confirm this one. It also happens on 32bit. tried with K3b trunk. Does not crash. Created attachment 42878 [details]
Fix for this bug
I'm a little disappointed that this was closed without further investigation. The code that is being used here is very obviously broken and the original bug had enough information to figure this out. There are three major bugs in the code. In fillOutputBuffer, you call avcodec_decode_audio2 but you don't check the return value. If it returns -1, you increase packet size by 1 every time and go into an infinite loop. You incorrectly set d->outputBufferSize to 0 before calling avcodec_decode_audio2, which is explicitly warned against in the documentation. You don't 16-byte align the output buffer. This is also explicitly warned against in the documentation and will result in crashes if you are using an sse2 enabled processor and you fix the previous two bugs. On top of those three, there's no way to return an error from fillOutputBuffer, even though the function can fail. I've attached a patch that fixes these problems for me. Any update on this? It'd be nice to get this patch submitted against head. Can someone provide an update on this bug? I don't think anything needs to be done besides submitting the attached patch. Created attachment 43817 [details]
Updated patch that applies cleanly at head
Created attachment 43825 [details]
Updated patch in svn diff format
changing this to unconfirmed now, since i apparently can't re-open :) @Jason Thank you for the extra information and work, we will look into this issue. Patch applied on revision 1130188. Thanks for patch and for patience! WebSVN link: http://websvn.kde.org/?view=rev&revision=1130188 |