Commit 9b01a8ad authored by Panagiotis H.M. Issaris's avatar Panagiotis H.M. Issaris Committed by Michael Niedermayer

Prevent segfault if iformat was not yet initialized.

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 366605ff
......@@ -2809,10 +2809,10 @@ void av_close_input_file(AVFormatContext *s)
void avformat_close_input(AVFormatContext **ps)
{
AVFormatContext *s = *ps;
AVIOContext *pb = (s->iformat->flags & AVFMT_NOFILE) || (s->flags & AVFMT_FLAG_CUSTOM_IO) ?
AVIOContext *pb = (s->iformat && (s->iformat->flags & AVFMT_NOFILE)) || (s->flags & AVFMT_FLAG_CUSTOM_IO) ?
NULL : s->pb;
flush_packet_queue(s);
if (s->iformat->read_close)
if (s->iformat && (s->iformat->read_close))
s->iformat->read_close(s);
avformat_free_context(s);
*ps = NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment