summaryrefslogtreecommitdiff
path: root/libavformat/rmdec.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-01-07 14:55:44 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2020-01-08 01:32:26 +0100
commit45e7c67affb57f0286fc111e61686025f4ef4a04 (patch)
treec00b4d1c671acb6f59837c2f41064340ed5a862e /libavformat/rmdec.c
parentbb20f3dd730689c3a99f7820cff8b74b06992fff (diff)
downloadffmpeg-45e7c67affb57f0286fc111e61686025f4ef4a04.tar.gz
avformat: Improve returned error codes
This commit improves returned error codes by forwarding error codes. In some instances, the hardcoded returned error codes made no sense at all: The normal error code for failure of av_new_packet() is AVERROR(ENOMEM), yet there were instances where AVERROR(EIO) was returned. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/rmdec.c')
-rw-r--r--libavformat/rmdec.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index 3c4b97d49f..a36e693ab2 100644
--- a/libavformat/rmdec.c
+++ b/libavformat/rmdec.c
@@ -781,8 +781,8 @@ static int rm_assemble_video_frame(AVFormatContext *s, AVIOContext *pb,
return -1;
}
rm->remaining_len -= len;
- if(av_new_packet(pkt, len + 9) < 0)
- return AVERROR(EIO);
+ if ((ret = av_new_packet(pkt, len + 9)) < 0)
+ return ret;
pkt->data[0] = 0;
AV_WL32(pkt->data + 1, 1);
AV_WL32(pkt->data + 5, 0);
@@ -804,8 +804,8 @@ static int rm_assemble_video_frame(AVFormatContext *s, AVIOContext *pb,
vst->slices = ((hdr & 0x3F) << 1) + 1;
vst->videobufsize = len2 + 8*vst->slices + 1;
av_packet_unref(&vst->pkt); //FIXME this should be output.
- if(av_new_packet(&vst->pkt, vst->videobufsize) < 0)
- return AVERROR(ENOMEM);
+ if ((ret = av_new_packet(&vst->pkt, vst->videobufsize)) < 0)
+ return ret;
memset(vst->pkt.data, 0, vst->pkt.size);
vst->videobufpos = 8*vst->slices + 1;
vst->cur_slice = 0;