diff options
author | James Almer <jamrial@gmail.com> | 2022-01-14 22:09:20 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2022-01-14 22:09:20 -0300 |
commit | 45e45a606077ccd0aab7eaffb8697e633b876fb2 (patch) | |
tree | 23c55686a834f962127f6d652ac5730215edd763 | |
parent | 7d377558a6c5f7e0592487f38bb76a8b99aada7a (diff) |
avcodec/libmp3lame: return proper error codes
Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r-- | libavcodec/libmp3lame.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/libmp3lame.c b/libavcodec/libmp3lame.c index 5675864bb2..e8082fade3 100644 --- a/libavcodec/libmp3lame.c +++ b/libavcodec/libmp3lame.c @@ -138,7 +138,7 @@ static av_cold int mp3lame_encode_init(AVCodecContext *avctx) /* set specified parameters */ if (lame_init_params(s->gfp) < 0) { - ret = -1; + ret = AVERROR_EXTERNAL; goto error; } @@ -231,7 +231,7 @@ static int mp3lame_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, "lame: output buffer too small (buffer index: %d, free bytes: %d)\n", s->buffer_index, s->buffer_size - s->buffer_index); } - return -1; + return AVERROR(ENOMEM); } s->buffer_index += lame_result; ret = realloc_buffer(s); @@ -259,7 +259,7 @@ static int mp3lame_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, return AVERROR_BUG; } else if (ret) { av_log(avctx, AV_LOG_ERROR, "free format output not supported\n"); - return -1; + return AVERROR_INVALIDDATA; } len = hdr.frame_size; ff_dlog(avctx, "in:%d packet-len:%d index:%d\n", avctx->frame_size, len, |