Commit 30cdfb49 authored by Måns Rullgård's avatar Måns Rullgård

asfdec: ensure number of streams is within bounds; remove VLA in asf_read_pts()

Originally committed as revision 23756 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent dd93649b
......@@ -35,6 +35,7 @@ void ff_mms_set_stream_selection(URLContext *h, AVFormatContext *format);
#undef NDEBUG
#include <assert.h>
#define ASF_MAX_STREAMS 127
#define FRAME_HEADER_SIZE 17
// Fix Me! FRAME_HEADER_SIZE may be different.
......@@ -244,6 +245,11 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap)
int64_t pos1, pos2, start_time;
int test_for_ext_stream_audio, is_dvr_ms_audio=0;
if (s->nb_streams == ASF_MAX_STREAMS) {
av_log(s, AV_LOG_ERROR, "too many streams\n");
return AVERROR(EINVAL);
}
pos1 = url_ftell(pb);
st = av_new_stream(s, 0);
......@@ -1053,7 +1059,7 @@ static int64_t asf_read_pts(AVFormatContext *s, int stream_index, int64_t *ppos,
int64_t pts;
int64_t pos= *ppos;
int i;
int64_t start_pos[s->nb_streams];
int64_t start_pos[ASF_MAX_STREAMS];
for(i=0; i<s->nb_streams; i++){
start_pos[i]= pos;
......
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