[FFmpeg-devel] [PATCH] misc libvorbis.c fixes

Michael Niedermayer michaelni
Fri Jul 2 16:03:58 CEST 2010


On Thu, Jul 01, 2010 at 11:29:03PM -0700, Pascal Massimino wrote:
> On Tue, Jun 29, 2010 at 12:44 AM, Pascal Massimino <
> pascal.massimino at gmail.com> wrote:
> 
> > Alex,
> >
> > On Tue, Jun 29, 2010 at 12:33 AM, Alex Converse <alex.converse at gmail.com>wrote:
> >
> >> On Tue, Jun 29, 2010 at 3:24 AM, Pascal Massimino
> >> <pascal.massimino at gmail.com> wrote:
> >> > On Sun, Jun 27, 2010 at 7:40 AM, Carl Eugen Hoyos <cehoyos at ag.or.at>
> >> wrote:
> >> >
> >> >> Pascal Massimino <pascal.massimino <at> gmail.com> writes:
> >>
> >> Welcome back skal, I hope you'll stay a while.
> >>
> >
> > indeed, been a while...
> >
> >
> >> >> > $subj. Namely:
> >> >> > * remove an unneeded av_realloc()
> >> >> > * add some buffer checks
> >> >> > * use  avccontext->frame_size where appropriate
> >> >>
> >> >> Please send one patch per issue.
> >> >>
> >> >>
> >> > attached.
> >> >
> >>
> >> Normally I'm not one to be pedantic about this sort of thing but...
> >>
> >> > vorbis-1: remove an unneeded av_realloc()
> >> @@ -104,9 +107,10 @@
> >>     vorbis_analysis_headerout(&context->vd, &context->vc, &header,
> >>                                 &header_comm, &header_code);
> >>
> >> -    len = header.bytes + header_comm.bytes +  header_code.bytes;
> >> -    avccontext->extradata_size= 64 + len + len/255;
> >> -    p = avccontext->extradata= av_mallocz(avccontext->extradata_size);
> >> +    avccontext->extradata_size=
> >> +        1 + xiph_len(header.bytes) + xiph_len(header_comm.bytes)
> >> +         + header_code.bytes;
> >> +    p = avccontext->extradata = av_malloc(avccontext->extradata_size);
> >>     p[0] = 2;
> >>     offset = 1;
> >>     offset += av_xiphlacing(&p[offset], header.bytes);
> >>
> >> This indentation seems really strange.
> >>
> >
> > yeah, i'm unsure what to use here. Here's another try, attached
> >
> >
> >> > vorbis-3: add some buffer checks
> >> @@ -190,6 +197,11 @@
> >>         avccontext->coded_frame->pts= av_rescale_q(op2->granulepos,
> >> (AVRational){1, avccontext->sample_rate}, avccontext->time_base);
> >>         //FIXME we should reorder the user supplied pts and not
> >> assume that they are spaced by 1/sample_rate
> >>
> >> +        if (l > buf_size) {
> >> +          av_log(avccontext, AV_LOG_ERROR, "libvorbis: buffer
> >> overflow.");
> >> +          return -1;
> >> +        }
> >> +
> >>         memcpy(packets, op2->packet, l);
> >>         context->buffer_index -= l + sizeof(ogg_packet);
> >>         memmove(context->buffer, context->buffer + l +
> >> sizeof(ogg_packet), context->buffer_index);
> >>
> >> 4 spaces is the standard indentation in FFmpeg and seems to followed
> >> consistently in libvorbis.c
> >>
> >
> > arg yes, only got 1 out of 2 right.
> >
> >
> > skal
> >
> >
> ping? no taker?

david conrad seems maintainer of this
david?

if he doesnt reply you could try to send him a private mail or just
treaten to commit publically wait a few days and if noone objected
commit then if you think your change is ok.


[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When the tyrant has disposed of foreign enemies by conquest or treaty, and
there is nothing more to fear from them, then he is always stirring up
some war or other, in order that the people may require a leader. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100702/720f9d03/attachment.pgp>



More information about the ffmpeg-devel mailing list