Commit 6cfb33f9 authored by Peter Ross's avatar Peter Ross

ffplay: set stream_index to -1 earlier to prevent segfault

Signed-off-by: 's avatarPeter Ross <pross@xvid.org>
Reviewed-by: 's avatarMarton Balint <cus@passwd.hu>
parent 1217b06a
......@@ -2775,9 +2775,6 @@ static int read_thread(void *arg)
}
memset(st_index, -1, sizeof(st_index));
is->last_video_stream = is->video_stream = -1;
is->last_audio_stream = is->audio_stream = -1;
is->last_subtitle_stream = is->subtitle_stream = -1;
is->eof = 0;
ic = avformat_alloc_context();
......@@ -3083,6 +3080,9 @@ static VideoState *stream_open(const char *filename, AVInputFormat *iformat)
is = av_mallocz(sizeof(VideoState));
if (!is)
return NULL;
is->last_video_stream = is->video_stream = -1;
is->last_audio_stream = is->audio_stream = -1;
is->last_subtitle_stream = is->subtitle_stream = -1;
is->filename = av_strdup(filename);
if (!is->filename)
goto fail;
......
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