I believe AVERROR_INVALIDDATA is correct given my understanding of the Vorbis spec. I think all channels must be represented in the submap.
Aaron On Wed, Mar 7, 2012 at 2:51 PM, Luca Barbato <lu_z...@gentoo.org> wrote: > From: Aaron Colwell <acolw...@chromium.org> > > This fixes some invalid memory access caused later in the function > by res_chan[] not being set for all channels. This happens when a > channel doesn't appear a submap. This change simply returns a > decoder error when this situation is detected. > --- > > Changed it to apply and make it return a defined error. > Is that the correct error or that corner case should be supported? > (thus AVERROR_PATCHWELCOME) > > libavcodec/vorbisdec.c | 3 +++ > 1 files changed, 3 insertions(+), 0 deletions(-) > > diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c > index 0d491c8..4a7d609 100644 > --- a/libavcodec/vorbisdec.c > +++ b/libavcodec/vorbisdec.c > @@ -1581,6 +1581,9 @@ static int vorbis_parse_audio_packet(vorbis_context > *vc) > ch_left -= ch; > } > > + if (ch_left > 0) > + return AVERROR_INVALIDDATA; > + > // Inverse coupling > > for (i = mapping->coupling_steps - 1; i >= 0; --i) { //warning: i has > to be signed > -- > 1.7.8.rc1 > > _______________________________________________ > libav-devel mailing list > libav-devel@libav.org > https://lists.libav.org/mailman/listinfo/libav-devel >
_______________________________________________ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel