1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

lavu/tx: do not unconditionally free subcontexts if initialization fails

If a codelet initializes 2 subtransforms, and the second one fails,
the failure would free all subcontexts.
Instead, if there are subcontexts still left, don't free the array.
If all initializations fail, the init() function will return,
and reset_ctx() from the previous step will clean up all contained
subtransforms.
This commit is contained in:
Lynne 2022-01-29 01:02:37 +01:00
parent 265731f201
commit 7e35e0224c
No known key found for this signature in database
GPG Key ID: A2FEA5F03F034464

View File

@ -606,7 +606,8 @@ av_cold int ff_tx_init_subtx(AVTXContext *s, enum AVTXType type,
break;
}
av_freep(&s->sub);
if (!s->nb_sub)
av_freep(&s->sub);
end:
av_free(cd_matches);