avcodec/dct: Propagate error code from ff_rdft_init()

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
pull/304/head^2
Michael Niedermayer 6 years ago
parent bb2d8708f7
commit 0505b35a38
  1. 5
      libavcodec/dct.c

@ -178,6 +178,7 @@ av_cold int ff_dct_init(DCTContext *s, int nbits, enum DCTTransformType inverse)
{
int n = 1 << nbits;
int i;
int ret;
memset(s, 0, sizeof(*s));
@ -194,9 +195,9 @@ av_cold int ff_dct_init(DCTContext *s, int nbits, enum DCTTransformType inverse)
if (!s->csc2)
return AVERROR(ENOMEM);
if (ff_rdft_init(&s->rdft, nbits, inverse == DCT_III) < 0) {
if ((ret = ff_rdft_init(&s->rdft, nbits, inverse == DCT_III)) < 0) {
av_freep(&s->csc2);
return -1;
return ret;
}
for (i = 0; i < n / 2; i++)

Loading…
Cancel
Save