#6595 closed bug (fixed)
ffmpeg plugin's AVFormatReader crashes if given a file it can't handle.
Reported by: | scottmc | Owned by: | stippi |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | Audio & Video/Codecs | Version: | R1/Development |
Keywords: | ffmpeg media codec sniff | Cc: | |
Blocked By: | Blocking: | ||
Platform: | All |
Description (last modified by )
Instead of rejecting a file that it can't handle, FFMPEG plugin AVFormatReader crash in Sniff() cleanup.
Attachments (2)
Change History (15)
follow-up: 3 comment:2 by , 14 years ago
i'll have free time in the next weekend...i'll work on this ticket if no one is interested : )
comment:3 by , 14 years ago
Replying to Barrett:
i'll have free time in the next weekend...i'll work on this ticket if no one is interested : )
Sounds good, thanks!
comment:4 by , 14 years ago
Before of the BAlert problem there's a blocking bug on the ffmpeg plugin, this happens when is passed a file that it can't handle. Removing the ffmpeg plugin "solve" the problem. I don't know what is the best way to fix that...maybe checking if AVFormatReader::Reader::fSource is a media file through BNode? i think it need a look by a more experienced developer to get me on the right way.
follow-up: 6 comment:5 by , 14 years ago
Component: | Applications/MediaConverter → Audio & Video/Codecs |
---|---|
Description: | modified (diff) |
Keywords: | ffmpeg media codec sniff added |
Owner: | changed from | to
Status: | new → assigned |
Summary: | MediaConverter crashes if given a file it can't handle. → ffmpeg plugin's AVFormatReader crashes if given a file it can't handle. |
Reproduced here. Seems, indeed, not a MediaConverter issue but a crashing condition in ffmpeg's AVFormatReader::Sniff() cleanup on unknown file.
comment:6 by , 14 years ago
Replying to phoudoin:
Reproduced here. Seems, indeed, not a MediaConverter issue but a crashing condition in ffmpeg's AVFormatReader::Sniff() cleanup on unknown file.
Actually, at the time I created this ticket (hrev38346), the ffmpeg plugin was not crashing, but in fact the BAlert constructor was (or something to that effect). Perhaps the two are related, but it was, IIRC a different crash.
comment:7 by , 14 years ago
The BAlert problem is still present, but it do not happens always and you should at least filter for media files or the ffmpeg crash will hide that.
comment:8 by , 14 years ago
Looking at the code, i found the problem (maybe) :
The struct fIOContext has a member named buffer, it is initialized at StreamBase::Open() line 297, since the file we are trying to read is not a media file the function av_probe_input_format() fail and the code after line 283 is not executed. There's a delete for fIOContext.buffer in ~StreamBase(), the Stream is deleted by an AutoDeleter in AVFormatReader::Sniff() (see the screenshot). Setting fIOContext.buffer to NULL in StreamBase() seems to solve the ffmpeg problem (but not the BAlert one)...if anyone give me a feedback i can make the patch...i'm not sure if my remarks are right.
comment:10 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Thanks everyone involved! Assuming the ticket is fixed and was only not closed due to hidden "Modify ticket" controls...
comment:11 by , 14 years ago
I think the only open question was if the BAlert problem mentioned earlier still occurs, but if it does it probably merits a separate ticket anyways.
comment:12 by , 14 years ago
As mentioned the BAlert crash is still alive. I'm investigating on that, i hope to get the bug fixed tomorrow (or in some days at least)..maybe a new ticket is not needed.
comment:13 by , 14 years ago
The problem disappeared when i updated libmedia.so from rev39350 to the mine installation (hrev39160). I really don't know why, maybe the cause was the difference of libmedia versions. On the latest image from haiku files the problem seems fixed also. I'm preparing a patch with little improvements for MediaConverter and ffmpeg.