diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2019-12-10 22:59:53 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-12-12 19:25:33 +0100 |
commit | c1e439d7e9abab3cebdc937636393b1656e095d9 (patch) | |
tree | be0ae941a23b62c42b152e2b9aa0a22f8c793d4e /libavformat/nuv.c | |
parent | cb88cdf7730e309df22ddbbc1ae4ebcd9ebc529e (diff) | |
download | ffmpeg-c1e439d7e9abab3cebdc937636393b1656e095d9.tar.gz |
avformat: Forward errors where possible
It is not uncommon to find code where the caller thinks to know better
what the return value should be than the callee. E.g. something like
"if (av_new_packet(pkt, size) < 0) return AVERROR(ENOMEM);". This commit
changes several instances of this to instead forward the actual error.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/nuv.c')
-rw-r--r-- | libavformat/nuv.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavformat/nuv.c b/libavformat/nuv.c index a1edbf88df..612f845b4b 100644 --- a/libavformat/nuv.c +++ b/libavformat/nuv.c @@ -74,7 +74,7 @@ static int get_codec_data(AVFormatContext *s, AVIOContext *pb, AVStream *vst, if (!vst && !myth) return 1; // no codec data needed while (!avio_feof(pb)) { - int size, subtype; + int size, subtype, ret; frametype = avio_r8(pb); switch (frametype) { @@ -87,8 +87,8 @@ static int get_codec_data(AVFormatContext *s, AVIOContext *pb, AVStream *vst, av_freep(&vst->codecpar->extradata); vst->codecpar->extradata_size = 0; } - if (ff_get_extradata(NULL, vst->codecpar, pb, size) < 0) - return AVERROR(ENOMEM); + if ((ret = ff_get_extradata(NULL, vst->codecpar, pb, size)) < 0) + return ret; size = 0; if (!myth) return 0; |