Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLynne <dev@lynne.ee>2022-09-22 09:25:52 +0300
committerLynne <dev@lynne.ee>2022-09-23 13:33:31 +0300
commit7e7baf8ab86c4ae715f12d2c0babf831a5b18c39 (patch)
tree404ea9321099f2ed271b4defa5a25d72cc2936c1 /libavutil/tx_template.c
parent686096739b129c7e3ea26be29c875e0887e58c49 (diff)
lavu/tx: do not steal lookup tables of subcontexts in the iMDCT
As it happens, some still need their contexts.
Diffstat (limited to 'libavutil/tx_template.c')
-rw-r--r--libavutil/tx_template.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/libavutil/tx_template.c b/libavutil/tx_template.c
index 5e7159bd87..2c9682ffb7 100644
--- a/libavutil/tx_template.c
+++ b/libavutil/tx_template.c
@@ -965,15 +965,14 @@ static av_cold int TX_NAME(ff_tx_mdct_init)(AVTXContext *s,
return ret;
}
- /* If we need to preshuffle just steal the map from the subcontext */
+ s->map = av_malloc((len >> 1)*sizeof(*s->map));
+ if (!s->map)
+ return AVERROR(ENOMEM);
+
+ /* If we need to preshuffle copy the map from the subcontext */
if (s->sub[0].flags & FF_TX_PRESHUFFLE) {
- s->map = s->sub[0].map;
- s->sub[0].map = NULL;
+ memcpy(s->map, s->sub->map, (len >> 1)*sizeof(*s->map));
} else {
- s->map = av_malloc((len >> 1)*sizeof(*s->map));
- if (!s->map)
- return AVERROR(ENOMEM);
-
for (int i = 0; i < len >> 1; i++)
s->map[i] = i;
}