[FFmpeg-cvslog] avcodec/magicyuvenc: Avoid excessive logmessages
Andreas Rheinhardt
git at videolan.org
Sun Apr 20 23:31:31 EEST 2025
ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Thu Apr 17 13:31:33 2025 +0200| [d42ba1384a03eedc389a1b5fea4a9d95fc8d6b33] | committer: Andreas Rheinhardt
avcodec/magicyuvenc: Avoid excessive logmessages
AVERROR(ENOMEM) is enough.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d42ba1384a03eedc389a1b5fea4a9d95fc8d6b33
---
libavcodec/magicyuvenc.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/libavcodec/magicyuvenc.c b/libavcodec/magicyuvenc.c
index e66d5c11cb..94e8d31122 100644
--- a/libavcodec/magicyuvenc.c
+++ b/libavcodec/magicyuvenc.c
@@ -233,10 +233,8 @@ static av_cold int magy_encode_init(AVCodecContext *avctx)
sl->slice = av_malloc(avctx->width * (s->slice_height + 2) +
AV_INPUT_BUFFER_PADDING_SIZE);
- if (!sl->slice) {
- av_log(avctx, AV_LOG_ERROR, "Cannot allocate temporary buffer.\n");
+ if (!sl->slice)
return AVERROR(ENOMEM);
- }
}
}
@@ -250,11 +248,8 @@ static av_cold int magy_encode_init(AVCodecContext *avctx)
avctx->extradata = av_mallocz(avctx->extradata_size +
AV_INPUT_BUFFER_PADDING_SIZE);
-
- if (!avctx->extradata) {
- av_log(avctx, AV_LOG_ERROR, "Could not allocate extradata.\n");
+ if (!avctx->extradata)
return AVERROR(ENOMEM);
- }
bytestream2_init_writer(&pb, avctx->extradata, MAGICYUV_EXTRADATA_SIZE);
bytestream2_put_le32u(&pb, MKTAG('M', 'A', 'G', 'Y'));
More information about the ffmpeg-cvslog
mailing list