[FFmpeg-devel] [PATCH] avformat/concatdec: do not close previous input if failed to open next

Zhang Rui bbcallen at gmail.com
Thu Jan 29 10:25:56 CET 2015


2015-01-29 16:41 GMT+08:00 Nicolas George <george at nsup.org>:
> Le decadi 10 pluviôse, an CCXXIII, Zhang Rui a écrit :
>> Avoid NULL access in next call of concat_read_packet().
> Can you explain how to trigger it?

I use concatdec for concat multiple stream over http protocol,
by set option "safe"=0.

After a failed switching from one url to another, application calls
av_read_frame() again at top-level, that would cause NULL
access In function concat_read_packet(),

> Another solution is to add:
>
>     if (!cat->avf)
>         return AVERROR(EIO);
>
> at the beginning of concat_read_packet(). I have a feeling that this would
> be cleaner, but ultimately it depends on the use case.

Yes, you are right. It's much more cleaner.


More information about the ffmpeg-devel mailing list