[haiku-bugs] Re: [Haiku] #6595: ffmpeg plugin's AVFormatReader crashes if given a file it can't handle.

  • From: "Barrett" <trac@xxxxxxxxxxxx>
  • Date: Tue, 09 Nov 2010 14:19:47 -0000

#6595: ffmpeg plugin's AVFormatReader crashes if given a file it can't handle.
----------------------------------+----------------------------------------
  Reporter:  scottmc              |        Owner:  stippi
      Type:  bug                  |       Status:  assigned
  Priority:  normal               |    Milestone:  R1
 Component:  Audio &              |      Version:  R1/Development
  Video/Codecs                    |     Keywords:  ffmpeg media codec sniff
Resolution:                       |  Has a Patch:  0
Blocked By:                       |     Blocking:
  Platform:  All                  |
----------------------------------+----------------------------------------

Comment (by Barrett):

 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.

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/6595#comment:8>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: