summaryrefslogtreecommitdiff
path: root/libavformat/mpc8.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/mpc8.c')
-rw-r--r--libavformat/mpc8.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libavformat/mpc8.c b/libavformat/mpc8.c
index e452cd6878..dd13bbd0a4 100644
--- a/libavformat/mpc8.c
+++ b/libavformat/mpc8.c
@@ -212,7 +212,7 @@ static int mpc8_read_header(AVFormatContext *s)
MPCContext *c = s->priv_data;
AVIOContext *pb = s->pb;
AVStream *st;
- int tag = 0;
+ int tag = 0, ret;
int64_t size, pos;
c->header_pos = avio_tell(pb);
@@ -253,8 +253,8 @@ static int mpc8_read_header(AVFormatContext *s)
st->codecpar->codec_id = AV_CODEC_ID_MUSEPACK8;
st->codecpar->bits_per_coded_sample = 16;
- if (ff_get_extradata(s, st->codecpar, pb, 2) < 0)
- return AVERROR(ENOMEM);
+ if ((ret = ff_get_extradata(s, st->codecpar, pb, 2)) < 0)
+ return ret;
st->codecpar->channels = (st->codecpar->extradata[1] >> 4) + 1;
st->codecpar->sample_rate = mpc8_rate[st->codecpar->extradata[0] >> 5];
@@ -277,7 +277,7 @@ static int mpc8_read_header(AVFormatContext *s)
static int mpc8_read_packet(AVFormatContext *s, AVPacket *pkt)
{
MPCContext *c = s->priv_data;
- int tag;
+ int tag, ret;
int64_t pos, size;
while(!avio_feof(s->pb)){
@@ -291,8 +291,8 @@ static int mpc8_read_packet(AVFormatContext *s, AVPacket *pkt)
if (size < 0)
return -1;
if(tag == TAG_AUDIOPACKET){
- if(av_get_packet(s->pb, pkt, size) < 0)
- return AVERROR(ENOMEM);
+ if ((ret = av_get_packet(s->pb, pkt, size)) < 0)
+ return ret;
pkt->stream_index = 0;
pkt->duration = 1;
return 0;