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
27752775 }
27762776
27772777 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;
27812778 is->eof = 0;
27822779
27832780 ic = avformat_alloc_context();
@@ -3083,6 +3080,9 @@ static VideoState *stream_open(const char *filename, AVInputFormat *iformat) · 299 unmodified lines
30833080 is = av_mallocz(sizeof(VideoState));
30843081 if (!is)
30853082 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;
30863086 is->filename = av_strdup(filename);
30873087 if (!is->filename)
30883088 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