[haiku-commits] haiku: hrev46441 - src/add-ons/media/plugins/ffmpeg

  • From: pulkomandy@xxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 25 Nov 2013 14:12:01 +0100 (CET)

hrev46441 adds 1 changeset to branch 'master'
old head: 38b150a9de3b51a7b9de6e6e85c066b57d43fc06
new head: 9394e66cbceb75f1f29c62224ced948d62ffda94
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=9394e66+%5E38b150a

----------------------------------------------------------------------------

9394e66: ffmpeg plugin: don't crash sniffing unknown files.
  
  The Open method can fail and leave the StreamBase object without an
  IOContext, but the destructor tried to dereference it anyway.
  
  This fixes APlayer crashing on many files instead of skipping them.

                             [ Adrien Destugues <pulkomandy@xxxxxxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev46441
Commit:      9394e66cbceb75f1f29c62224ced948d62ffda94
URL:         http://cgit.haiku-os.org/haiku/commit/?id=9394e66
Author:      Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
Date:        Mon Nov 25 13:01:59 2013 UTC

----------------------------------------------------------------------------

1 file changed, 2 insertions(+), 1 deletion(-)
src/add-ons/media/plugins/ffmpeg/AVFormatReader.cpp | 3 ++-

----------------------------------------------------------------------------

diff --git a/src/add-ons/media/plugins/ffmpeg/AVFormatReader.cpp 
b/src/add-ons/media/plugins/ffmpeg/AVFormatReader.cpp
index 7531060..b10b62b 100644
--- a/src/add-ons/media/plugins/ffmpeg/AVFormatReader.cpp
+++ b/src/add-ons/media/plugins/ffmpeg/AVFormatReader.cpp
@@ -242,7 +242,8 @@ StreamBase::~StreamBase()
                avformat_close_input(&fContext);
        av_free_packet(&fPacket);
        av_free(fContext);
-       av_free(fIOContext->buffer);
+       if(fIOContext)
+               av_free(fIOContext->buffer);
        av_free(fIOContext);
 }
 


Other related posts: