avcodec/dct: use av_freep(), do not leave stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -193,7 +193,7 @@ av_cold int ff_dct_init(DCTContext *s, int nbits, enum DCTTransformType inverse)
|
|||||||
s->csc2 = av_malloc_array(n / 2, sizeof(FFTSample));
|
s->csc2 = av_malloc_array(n / 2, sizeof(FFTSample));
|
||||||
|
|
||||||
if (ff_rdft_init(&s->rdft, nbits, inverse == DCT_III) < 0) {
|
if (ff_rdft_init(&s->rdft, nbits, inverse == DCT_III) < 0) {
|
||||||
av_free(s->csc2);
|
av_freep(&s->csc2);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -218,5 +218,5 @@ av_cold int ff_dct_init(DCTContext *s, int nbits, enum DCTTransformType inverse)
|
|||||||
av_cold void ff_dct_end(DCTContext *s)
|
av_cold void ff_dct_end(DCTContext *s)
|
||||||
{
|
{
|
||||||
ff_rdft_end(&s->rdft);
|
ff_rdft_end(&s->rdft);
|
||||||
av_free(s->csc2);
|
av_freep(&s->csc2);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user