mirror of https://git.ffmpeg.org/ffmpeg.git
avcodec/libopenjpegenc: Check the return code of av_frame_ref()
Fixes CID1163842 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
7853024071
commit
52d2bcc786
|
@ -504,7 +504,10 @@ static int libopenjpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
|||
gbrframe = av_frame_alloc();
|
||||
if (!gbrframe)
|
||||
return AVERROR(ENOMEM);
|
||||
av_frame_ref(gbrframe, frame);
|
||||
if ((ret = av_frame_ref(gbrframe, frame)) < 0) {
|
||||
av_frame_free(&gbrframe);
|
||||
return ret;
|
||||
}
|
||||
gbrframe->data[0] = frame->data[2]; // swap to be rgb
|
||||
gbrframe->data[1] = frame->data[0];
|
||||
gbrframe->data[2] = frame->data[1];
|
||||
|
|
Loading…
Reference in New Issue