mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-01-12 00:06:51 +08:00
avcodec/lcevcdec: free pictures on error
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
@@ -126,8 +126,10 @@ static int lcevc_send_frame(void *logctx, FFLCEVCFrame *frame_ctx, const AVFrame
|
||||
return ret;
|
||||
|
||||
res = LCEVC_SendDecoderBase(lcevc->decoder, in->pts, picture, -1, NULL);
|
||||
if (res != LCEVC_Success)
|
||||
if (res != LCEVC_Success) {
|
||||
LCEVC_FreePicture(lcevc->decoder, picture);
|
||||
return AVERROR_EXTERNAL;
|
||||
}
|
||||
|
||||
memset(&picture, 0, sizeof(picture));
|
||||
ret = alloc_enhanced_frame(logctx, frame_ctx, &picture);
|
||||
@@ -135,8 +137,10 @@ static int lcevc_send_frame(void *logctx, FFLCEVCFrame *frame_ctx, const AVFrame
|
||||
return ret;
|
||||
|
||||
res = LCEVC_SendDecoderPicture(lcevc->decoder, picture);
|
||||
if (res != LCEVC_Success)
|
||||
if (res != LCEVC_Success) {
|
||||
LCEVC_FreePicture(lcevc->decoder, picture);
|
||||
return AVERROR_EXTERNAL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -154,8 +158,10 @@ static int generate_output(void *logctx, FFLCEVCFrame *frame_ctx, AVFrame *out)
|
||||
return AVERROR_EXTERNAL;
|
||||
|
||||
res = LCEVC_GetPictureDesc(lcevc->decoder, picture, &desc);
|
||||
if (res != LCEVC_Success)
|
||||
if (res != LCEVC_Success) {
|
||||
LCEVC_FreePicture(lcevc->decoder, picture);
|
||||
return AVERROR_EXTERNAL;
|
||||
}
|
||||
|
||||
out->crop_top = desc.cropTop;
|
||||
out->crop_bottom = desc.cropBottom;
|
||||
|
||||
Reference in New Issue
Block a user