提交 1c73391d 编写于 作者: M Michael Niedermayer

siff: Fix excessive memory allocation.

Bug found by: Oana Stratulat
Signed-off-by: NMichael Niedermayer <michaelni@gmx.at>
上级 af3f2a87
......@@ -201,7 +201,12 @@ static int siff_read_packet(AVFormatContext *s, AVPacket *pkt)
}
if (!c->curstrm){
int64_t fsize= avio_size(s->pb);
size = c->pktsize - c->sndsize;
if(fsize>0)
size= FFMIN(size, fsize - avio_tell(s->pb) + c->gmcsize + 3);
if(size < 2 + c->gmcsize || c->pktsize < c->sndsize)
return AVERROR_INVALIDDATA;
if (av_new_packet(pkt, size) < 0)
return AVERROR(ENOMEM);
AV_WL16(pkt->data, c->flags);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册