Fix memory leak when proxy building fails

Leak introduced in recent fix - bf8d4a9bc6.
This commit is contained in:
Richard Antalik 2022-10-20 17:54:29 +02:00
parent 4b30ee773c
commit 24fd8f729a
1 changed files with 3 additions and 0 deletions

View File

@ -909,6 +909,9 @@ static IndexBuildContext *index_ffmpeg_create_context(struct anim *anim,
if (context->proxy_ctx[0] == NULL && context->proxy_ctx[1] == NULL &&
context->proxy_ctx[2] == NULL && context->proxy_ctx[3] == NULL) {
avformat_close_input(&context->iFormatCtx);
avcodec_free_context(&context->iCodecCtx);
MEM_freeN(context);
return NULL; /* Nothing to transcode. */
}