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.
This commit is contained in:
Adrien Destugues 2013-11-25 14:01:59 +01:00
parent 38b150a9de
commit 9394e66cbc

View File

@ -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);
}