[FFmpeg-devel] [PATCH] lavfi/avf_showspectrum: check RDFT contet init.

Nicolas George george at nsup.org
Sun Aug 3 22:57:53 CEST 2014


Le sextidi 16 thermidor, an CCXXII, Timothy Gu a écrit :
> >          s->rdft = av_rdft_init(rdft_bits, DFT_R2C);
> > +        if (!s->rdft) {
> > +            av_log(ctx, AV_LOG_ERROR, "Unable to allocate RDFT context. "
> > +                   "Maybe window too high.\n");
> > +            return AVERROR(EINVAL);
> ENOMEM?

Ideally, av_rdft_init() would return a proper error code, but that is not
the case. In practice, on modern operating systems, memory allocation for
something that small will never fail. On the other hand, trying to init for
an unsupported window size (<4 or >16) is a very obvious error. Therefore I
believe EINVAL is more likely to reflect the actual error than ENOMEM.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140803/ed80cb0c/attachment.asc>


More information about the ffmpeg-devel mailing list