On Thu, Apr 28, 2011 at 12:14:43PM +0300, Martin Storsjö wrote:
> On Thu, 28 Apr 2011, Diego Biurrun wrote:
> > --- a/libavcodec/vorbisdec.c
> > +++ b/libavcodec/vorbisdec.c
> > @@ -753,7 +753,7 @@ static int
> > vorbis_parse_setup_hdr_mappings(vorbis_context *vc)
> >
> > if (mapping_setup->submaps>1) {
> > - mapping_setup->mux = av_mallocz(vc->audio_channels *
> > sizeof(uint_fast8_t));
> > + mapping_setup->mux = av_mallocz(vc->audio_channels *
> > sizeof(mapping_setup->mux));
> > for (j = 0; j < vc->audio_channels; ++j)
> > mapping_setup->mux[j] = get_bits(gb, 4);
>
> This isn't right - as Måns pointed out in reply to the earlier mail, you
> should do
>
> ptr = malloc(count * sizeof(*ptr))
>
> Now you do sizeof(ptr), which isn't what you want (usually it might be as
> big or bigger than what you want, in some cases it might be smaller).
I just realized I had a big brainfart somewhere in there when reading
that struct definition. I'll send a new patch in a moment.
Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel