Mercurial > libavformat.hg
comparison utils.c @ 5314:3000edd97499 libavformat
check stream index validity in av_program_add_stream_index
author | bcoudurier |
---|---|
date | Mon, 19 Oct 2009 18:55:27 +0000 |
parents | af8dbf123fc8 |
children | d6780bb3fde6 |
comparison
equal
deleted
inserted
replaced
5313:af8dbf123fc8 | 5314:3000edd97499 |
---|---|
2831 { | 2831 { |
2832 int i, j; | 2832 int i, j; |
2833 AVProgram *program=NULL; | 2833 AVProgram *program=NULL; |
2834 void *tmp; | 2834 void *tmp; |
2835 | 2835 |
2836 if (idx >= ac->nb_streams) { | |
2837 av_log(ac, AV_LOG_ERROR, "stream index %d is not valid\n", idx); | |
2838 return; | |
2839 } | |
2840 | |
2836 for(i=0; i<ac->nb_programs; i++){ | 2841 for(i=0; i<ac->nb_programs; i++){ |
2837 if(ac->programs[i]->id != progid) | 2842 if(ac->programs[i]->id != progid) |
2838 continue; | 2843 continue; |
2839 program = ac->programs[i]; | 2844 program = ac->programs[i]; |
2840 for(j=0; j<program->nb_stream_indexes; j++) | 2845 for(j=0; j<program->nb_stream_indexes; j++) |