check stream index validity in av_program_add_stream_index
Originally committed as revision 20319 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
8425cecacc
commit
72017ea1dc
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user