mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-06-08 16:30:26 +00:00
avcodec/lcevcdec: free pictures on error
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit fe1dae1e18)
This commit is contained in:
parent
0d9b8bfc0e
commit
c74b4512e0
1 changed files with 9 additions and 3 deletions
|
|
@ -132,8 +132,10 @@ static int lcevc_send_frame(void *logctx, FFLCEVCFrame *frame_ctx, const AVFrame
|
|||
#else
|
||||
res = LCEVC_SendDecoderBase(lcevc->decoder, in->pts, 0, picture, -1, NULL);
|
||||
#endif
|
||||
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);
|
||||
|
|
@ -141,8 +143,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;
|
||||
}
|
||||
|
|
@ -160,8 +164,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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue