[FFmpeg-devel] [PATCH] libavformat: Segfault on Apple HTTP Livestream playlist with unavailable hosts

Takis Issaris takis.issaris at uhasselt.be
Tue Jan 3 16:20:45 CET 2012


Happy new year! :-) And sorry for the late reply...


2011/12/14 Michael Niedermayer <michaelni at gmx.at>:
> On Wed, Dec 14, 2011 at 05:32:35PM +0100, Nicolas George wrote:
>> Le quartidi 24 frimaire, an CCXX, Takis Issaris a écrit :
>> > The attached patch checks the AVFormatContext->iformat pointer before
>> > dereferencing it.
>>
>> That seems wrong: there are a lot of places that dereference iformat
>> unconditionally, thus it seems that it being not null is implicitly part of
>> the API.
>>
>> According to your ticket :
>>
>> > the code jumps to fail, which invokes free_variant_list() which in turn
>> > invokes avformat_close_input()
>>
>> I believe free_variant_list is wrong to call avformat_close_input on format
>> contexts that have not been properly opened.
>
> hmm, seems i commited that before there was a consensus ...

Well, frankly, I prefer having a working fix committed before
consensus for security bugs and bugs causing crashes. The applied
patch can always easily be replaced after a consensus is reached.


> to me it looks convenient to just be able to call close/free without
> needing to protect each call with checks. That is rather have the
> checks inside the free/close function

Agreed.


With friendly regards,
Takis

PS: This is actually part 2 of my intended replies, the first one to
Nicolas I had already sent two weeks ago, this one I actually forgot.


More information about the ffmpeg-devel mailing list