comparison 4xm.c @ 4295:36a6d25e95ea libavformat

better header_size check
author michael
date Tue, 27 Jan 2009 21:01:47 +0000
parents e6b06b0c611a
children 42a9dba93e69
comparison
equal deleted inserted replaced
4294:e6b06b0c611a 4295:36a6d25e95ea
112 url_fseek(pb, 12, SEEK_CUR); 112 url_fseek(pb, 12, SEEK_CUR);
113 113
114 /* check for LIST-HEAD */ 114 /* check for LIST-HEAD */
115 GET_LIST_HEADER(); 115 GET_LIST_HEADER();
116 header_size = size - 4; 116 header_size = size - 4;
117 if (fourcc_tag != HEAD_TAG || size < 4) 117 if (fourcc_tag != HEAD_TAG || header_size < 0)
118 return AVERROR_INVALIDDATA; 118 return AVERROR_INVALIDDATA;
119 119
120 /* allocate space for the header and load the whole thing */ 120 /* allocate space for the header and load the whole thing */
121 header = av_malloc(header_size); 121 header = av_malloc(header_size);
122 if (!header) 122 if (!header)