|
|
@ -721,11 +721,15 @@ static int iff_read_packet(AVFormatContext *s, |
|
|
|
if (st->codec->codec_tag == ID_DSD || st->codec->codec_tag == ID_MAUD) { |
|
|
|
if (st->codec->codec_tag == ID_DSD || st->codec->codec_tag == ID_MAUD) { |
|
|
|
ret = av_get_packet(pb, pkt, FFMIN(iff->body_end - pos, 1024 * st->codec->block_align)); |
|
|
|
ret = av_get_packet(pb, pkt, FFMIN(iff->body_end - pos, 1024 * st->codec->block_align)); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
if (iff->body_size > INT_MAX) |
|
|
|
|
|
|
|
return AVERROR_INVALIDDATA; |
|
|
|
ret = av_get_packet(pb, pkt, iff->body_size); |
|
|
|
ret = av_get_packet(pb, pkt, iff->body_size); |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { |
|
|
|
} else if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { |
|
|
|
uint8_t *buf; |
|
|
|
uint8_t *buf; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (iff->body_size > INT_MAX - 2) |
|
|
|
|
|
|
|
return AVERROR_INVALIDDATA; |
|
|
|
if (av_new_packet(pkt, iff->body_size + 2) < 0) { |
|
|
|
if (av_new_packet(pkt, iff->body_size + 2) < 0) { |
|
|
|
return AVERROR(ENOMEM); |
|
|
|
return AVERROR(ENOMEM); |
|
|
|
} |
|
|
|
} |
|
|
|