Commit 1c73391d authored by Michael Niedermayer's avatar Michael Niedermayer

siff: Fix excessive memory allocation.

Bug found by: Oana Stratulat
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 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% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment