From c1e439d7e9abab3cebdc937636393b1656e095d9 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Tue, 10 Dec 2019 22:59:53 +0100 Subject: 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 Signed-off-by: Michael Niedermayer --- libavformat/apetag.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libavformat/apetag.c') diff --git a/libavformat/apetag.c b/libavformat/apetag.c index 4e19f49bf1..454c6c688b 100644 --- a/libavformat/apetag.c +++ b/libavformat/apetag.c @@ -96,8 +96,8 @@ static int ape_tag_read_field(AVFormatContext *s) st->attached_pic.stream_index = st->index; st->attached_pic.flags |= AV_PKT_FLAG_KEY; } else { - if (ff_get_extradata(s, st->codecpar, s->pb, size) < 0) - return AVERROR(ENOMEM); + if ((ret = ff_get_extradata(s, st->codecpar, s->pb, size)) < 0) + return ret; st->codecpar->codec_type = AVMEDIA_TYPE_ATTACHMENT; } } else { -- cgit v1.2.3