1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-10 06:10:52 +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

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);