Skip to content
Snippets Groups Projects
Unverified Commit 7e7baf8a authored by Lynne's avatar Lynne
Browse files

lavu/tx: do not steal lookup tables of subcontexts in the iMDCT

As it happens, some still need their contexts.
parent 68609673
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment