History

ffplay: set stream_index to -1 earlier to prevent segfault

Peter Ross committed 6 years ago

Commit 6cfb33f1 parent 1217b061 file · +3 −3Browse files

Unified · Split

fftools/ffplay.c+3−3
@@ -2775,9 +2775,6 @@ static int read_thread(void *arg) · 2774 unmodified lines
2775 }2775 }
2776 2776
2777 memset(st_index, -1, sizeof(st_index));2777 memset(st_index, -1, sizeof(st_index));
2778 is->last_video_stream = is->video_stream = -1;
2779 is->last_audio_stream = is->audio_stream = -1;
2780 is->last_subtitle_stream = is->subtitle_stream = -1;
2781 is->eof = 0;2778 is->eof = 0;
2782 2779
2783 ic = avformat_alloc_context();2780 ic = avformat_alloc_context();
@@ -3083,6 +3080,9 @@ static VideoState *stream_open(const char *filename, AVInputFormat *iformat) · 299 unmodified lines
3083 is = av_mallocz(sizeof(VideoState));3080 is = av_mallocz(sizeof(VideoState));
3084 if (!is)3081 if (!is)
3085 return NULL;3082 return NULL;
3083 is->last_video_stream = is->video_stream = -1;
3084 is->last_audio_stream = is->audio_stream = -1;
3085 is->last_subtitle_stream = is->subtitle_stream = -1;
3086 is->filename = av_strdup(filename);3086 is->filename = av_strdup(filename);
3087 if (!is->filename)3087 if (!is->filename)
3088 goto fail;3088 goto fail;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t