changeset 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 c80aaf5c36ab
files utils.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/utils.c	Mon Oct 19 18:53:32 2009 +0000
+++ b/utils.c	Mon Oct 19 18:55:27 2009 +0000
@@ -2833,6 +2833,11 @@
     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;