Commit ffa909d3 authored by bcoudurier's avatar bcoudurier

check stream index validity in av_program_add_stream_index

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@20319 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 48a11724
...@@ -2833,6 +2833,11 @@ void av_program_add_stream_index(AVFormatContext *ac, int progid, unsigned int i ...@@ -2833,6 +2833,11 @@ void av_program_add_stream_index(AVFormatContext *ac, int progid, unsigned int i
AVProgram *program=NULL; AVProgram *program=NULL;
void *tmp; void *tmp;
if (idx >= ac->nb_streams) {
av_log(ac, AV_LOG_ERROR, "stream index %d is not valid\n", idx);
return;
}
for(i=0; i<ac->nb_programs; i++){ for(i=0; i<ac->nb_programs; i++){
if(ac->programs[i]->id != progid) if(ac->programs[i]->id != progid)
continue; continue;
......
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