Commit ad94c6ca authored by Vittorio Giovara's avatar Vittorio Giovara

siff: Use the correct type for packet size variables

The avio functions used here return an unsigned value.
Also reduce a variable scope.

CC: libav-stable@libav.org
Bug-Id: CID 1258461
parent 9f25a109
...@@ -53,11 +53,11 @@ typedef struct SIFFContext { ...@@ -53,11 +53,11 @@ typedef struct SIFFContext {
int has_audio; int has_audio;
int curstrm; int curstrm;
int pktsize; unsigned int pktsize;
int gmcsize; int gmcsize;
int sndsize; int sndsize;
int flags; unsigned int flags;
uint8_t gmc[4]; uint8_t gmc[4];
} SIFFContext; } SIFFContext;
...@@ -189,9 +189,9 @@ static int siff_read_header(AVFormatContext *s) ...@@ -189,9 +189,9 @@ static int siff_read_header(AVFormatContext *s)
static int siff_read_packet(AVFormatContext *s, AVPacket *pkt) static int siff_read_packet(AVFormatContext *s, AVPacket *pkt)
{ {
SIFFContext *c = s->priv_data; SIFFContext *c = s->priv_data;
int size;
if (c->has_video) { if (c->has_video) {
unsigned int size;
if (c->cur_frame >= c->frames) if (c->cur_frame >= c->frames)
return AVERROR(EIO); return AVERROR(EIO);
if (c->curstrm == -1) { if (c->curstrm == -1) {
...@@ -215,10 +215,11 @@ static int siff_read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -215,10 +215,11 @@ static int siff_read_packet(AVFormatContext *s, AVPacket *pkt)
pkt->stream_index = 0; pkt->stream_index = 0;
c->curstrm = -1; c->curstrm = -1;
} else { } else {
if ((size = av_get_packet(s->pb, pkt, c->sndsize - 4)) < 0) int pktsize = av_get_packet(s->pb, pkt, c->sndsize - 4);
if (pktsize < 0)
return AVERROR(EIO); return AVERROR(EIO);
pkt->stream_index = 1; pkt->stream_index = 1;
pkt->duration = size; pkt->duration = pktsize;
c->curstrm = 0; c->curstrm = 0;
} }
if (!c->cur_frame || c->curstrm) if (!c->cur_frame || c->curstrm)
...@@ -226,10 +227,10 @@ static int siff_read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -226,10 +227,10 @@ static int siff_read_packet(AVFormatContext *s, AVPacket *pkt)
if (c->curstrm == -1) if (c->curstrm == -1)
c->cur_frame++; c->cur_frame++;
} else { } else {
size = av_get_packet(s->pb, pkt, c->block_align); int pktsize = av_get_packet(s->pb, pkt, c->block_align);
if (size <= 0) if (pktsize <= 0)
return AVERROR(EIO); return AVERROR(EIO);
pkt->duration = size; pkt->duration = pktsize;
} }
return pkt->size; return pkt->size;
} }
......
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