mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-02 13:02:13 +00:00
lavc/libopenjpegenc: check av_frame_alloc() failure.
This commit is contained in:
parent
a91394f4de
commit
97af2faaba
@ -502,6 +502,8 @@ static int libopenjpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
||||
case AV_PIX_FMT_GBRP14:
|
||||
case AV_PIX_FMT_GBRP16:
|
||||
gbrframe = av_frame_alloc();
|
||||
if (!gbrframe)
|
||||
return AVERROR(ENOMEM);
|
||||
av_frame_ref(gbrframe, frame);
|
||||
gbrframe->data[0] = frame->data[2]; // swap to be rgb
|
||||
gbrframe->data[1] = frame->data[0];
|
||||
|
Loading…
Reference in New Issue
Block a user