diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2009-10-19 18:55:27 +0000 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2009-10-19 18:55:27 +0000 |
commit | 72017ea1dcae1cd4f9c3dd68a3c1a9d941c6b02a (patch) | |
tree | 2848c1f939e7ca73235440a48998081db9177970 /libavformat | |
parent | 8425cecacc35096ce41c34ab905cbffb9f9dce3d (diff) | |
download | ffmpeg-72017ea1dcae1cd4f9c3dd68a3c1a9d941c6b02a.tar.gz |
check stream index validity in av_program_add_stream_index
Originally committed as revision 20319 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/utils.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 58b3584c1d..4202fc26a2 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2833,6 +2833,11 @@ void av_program_add_stream_index(AVFormatContext *ac, int progid, unsigned int i AVProgram *program=NULL; 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++){ if(ac->programs[i]->id != progid) continue; |