提交 0c0fd063 编写于 作者: M Michael Niedermayer

Prevent infinite recursion of odml indexes.

This fixes a stack overflow.

Originally committed as revision 23925 to svn://svn.ffmpeg.org/ffmpeg/trunk
上级 4148855e
...@@ -61,6 +61,8 @@ typedef struct { ...@@ -61,6 +61,8 @@ typedef struct {
int non_interleaved; int non_interleaved;
int stream_index; int stream_index;
DVDemuxContext* dv_demux; DVDemuxContext* dv_demux;
int odml_depth;
#define MAX_ODML_DEPTH 1000
} AVIContext; } AVIContext;
static const char avi_headers[][8] = { static const char avi_headers[][8] = {
...@@ -190,8 +192,15 @@ static int read_braindead_odml_indx(AVFormatContext *s, int frame_num){ ...@@ -190,8 +192,15 @@ static int read_braindead_odml_indx(AVFormatContext *s, int frame_num){
pos = url_ftell(pb); pos = url_ftell(pb);
if(avi->odml_depth > MAX_ODML_DEPTH){
av_log(s, AV_LOG_ERROR, "Too deeply nested ODML indexes\n");
return -1;
}
url_fseek(pb, offset+8, SEEK_SET); url_fseek(pb, offset+8, SEEK_SET);
avi->odml_depth++;
read_braindead_odml_indx(s, frame_num); read_braindead_odml_indx(s, frame_num);
avi->odml_depth--;
frame_num += duration; frame_num += duration;
url_fseek(pb, pos, SEEK_SET); url_fseek(pb, pos, SEEK_SET);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册