You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-04 22:03:09 +02:00
avcodec/magicyuvenc: Avoid excessive logmessages
AVERROR(ENOMEM) is enough. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@ -233,10 +233,8 @@ static av_cold int magy_encode_init(AVCodecContext *avctx)
|
|||||||
|
|
||||||
sl->slice = av_malloc(avctx->width * (s->slice_height + 2) +
|
sl->slice = av_malloc(avctx->width * (s->slice_height + 2) +
|
||||||
AV_INPUT_BUFFER_PADDING_SIZE);
|
AV_INPUT_BUFFER_PADDING_SIZE);
|
||||||
if (!sl->slice) {
|
if (!sl->slice)
|
||||||
av_log(avctx, AV_LOG_ERROR, "Cannot allocate temporary buffer.\n");
|
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -250,11 +248,8 @@ static av_cold int magy_encode_init(AVCodecContext *avctx)
|
|||||||
|
|
||||||
avctx->extradata = av_mallocz(avctx->extradata_size +
|
avctx->extradata = av_mallocz(avctx->extradata_size +
|
||||||
AV_INPUT_BUFFER_PADDING_SIZE);
|
AV_INPUT_BUFFER_PADDING_SIZE);
|
||||||
|
if (!avctx->extradata)
|
||||||
if (!avctx->extradata) {
|
|
||||||
av_log(avctx, AV_LOG_ERROR, "Could not allocate extradata.\n");
|
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
}
|
|
||||||
|
|
||||||
bytestream2_init_writer(&pb, avctx->extradata, MAGICYUV_EXTRADATA_SIZE);
|
bytestream2_init_writer(&pb, avctx->extradata, MAGICYUV_EXTRADATA_SIZE);
|
||||||
bytestream2_put_le32u(&pb, MKTAG('M', 'A', 'G', 'Y'));
|
bytestream2_put_le32u(&pb, MKTAG('M', 'A', 'G', 'Y'));
|
||||||
|
Reference in New Issue
Block a user