Commit e71dce57 authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/siff: Fix checks and variable types

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 8f92c089
......@@ -56,7 +56,7 @@ typedef struct SIFFContext {
int curstrm;
unsigned int pktsize;
int gmcsize;
int sndsize;
unsigned int sndsize;
unsigned int flags;
uint8_t gmc[4];
......@@ -208,10 +208,11 @@ static int siff_read_packet(AVFormatContext *s, AVPacket *pkt)
}
if (!c->curstrm) {
if (c->pktsize < 2LL + c->sndsize + c->gmcsize)
return AVERROR_INVALIDDATA;
size = c->pktsize - c->sndsize - c->gmcsize - 2;
size = ffio_limit(s->pb, size);
if (size < 0 || c->pktsize < c->sndsize)
return AVERROR_INVALIDDATA;
if (av_new_packet(pkt, size + c->gmcsize + 2) < 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