[FFmpeg-devel] [libav-devel] [PATCH] aacsbr: break infinite loop in sbr_hf_calc_npatches
Michael Niedermayer
michaelni at gmx.at
Thu Apr 23 17:43:18 CEST 2015
On Thu, Apr 23, 2015 at 12:22:49PM -0300, Claudio Freire wrote:
> On Wed, Apr 22, 2015 at 1:52 PM, Vittorio Giovara
> <vittorio.giovara at gmail.com> wrote:
> >>>> I don't think the INVALIDDATA return will have the desired effect.
> >>>>
> >>>> I think you want return -1;
> >>>
> >>> This function is only called once and there the check is:
> >>> if (sbr_hf_calc_npatches(ac, sbr) < 0)
> >>> return -1;
> >>>
> >>> Thus returning AVERROR_INVALIDDATA works as well as -1.
> >>
> >> The fact that AVERROR_INVALIDDATA < 0 is a close call on 32 bit platforms.
> >>
> >> Still, it's not a new assumption in the code, so I'll grant you that.
> >
> > What do you mean by "A close call"? All AVERROR_* are negative by
> > design, and they carry more information than a -1, so their increased
> > usage is certainly welcome.
> > The fact that it does not get propagated is a separate issue.
>
> Just that it's not obvious, and I was thinking error-prone, but now I
> think it was just a reaction to it being non-obvious to me.
>
> So nothing relevant.
ok, so is the patch the correct solution or are the fields already
invalid before this loop and should have been checked prior ?
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150423/3594e542/attachment.asc>
More information about the ffmpeg-devel
mailing list