Lines 238-243
Link Here
|
238 |
avctx->bits_per_sample = get_le16(&s->gb); |
238 |
avctx->bits_per_sample = get_le16(&s->gb); |
239 |
s->bps = (avctx->bits_per_sample + 7) / 8; |
239 |
s->bps = (avctx->bits_per_sample + 7) / 8; |
240 |
avctx->sample_rate = get_le32(&s->gb); |
240 |
avctx->sample_rate = get_le32(&s->gb); |
|
|
241 |
if(avctx->sample_rate > 1000000){ //prevent FRAME_TIME * avctx->sample_rate from overflowing and sanity check |
242 |
av_log(avctx, AV_LOG_ERROR, "sample_rate too large\n"); |
243 |
return -1; |
244 |
} |
241 |
s->data_length = get_le32(&s->gb); |
245 |
s->data_length = get_le32(&s->gb); |
242 |
skip_bits(&s->gb, 32); // CRC32 of header |
246 |
skip_bits(&s->gb, 32); // CRC32 of header |
243 |
|
247 |
|
Lines 276-281
Link Here
|
276 |
skip_bits(&s->gb, 32); |
280 |
skip_bits(&s->gb, 32); |
277 |
skip_bits(&s->gb, 32); // CRC32 of seektable |
281 |
skip_bits(&s->gb, 32); // CRC32 of seektable |
278 |
|
282 |
|
|
|
283 |
if(s->frame_length >= UINT_MAX / (s->channels * sizeof(int32_t))){ |
284 |
av_log(avctx, AV_LOG_ERROR, "frame_length too large\n"); |
285 |
return -1; |
286 |
} |
287 |
|
279 |
s->decode_buffer = av_mallocz(sizeof(int32_t)*s->frame_length*s->channels); |
288 |
s->decode_buffer = av_mallocz(sizeof(int32_t)*s->frame_length*s->channels); |
280 |
} else { |
289 |
} else { |
281 |
av_log(avctx, AV_LOG_ERROR, "Wrong extradata present\n"); |
290 |
av_log(avctx, AV_LOG_ERROR, "Wrong extradata present\n"); |