[FFmpeg-devel] [PATCH] fix DV muxer stream count check

Reimar Döffinger Reimar.Doeffinger
Sat May 12 17:33:17 CEST 2007


Hello,
On Sat, May 12, 2007 at 05:21:40PM +0200, Michael Niedermayer wrote:
> On Sat, May 12, 2007 at 04:53:09PM +0200, Reimar D?ffinger wrote:
> > currently it is possible to pass the DV demuxer three audio streams
> > causing an access beyond a buffer or to pass it two video streams in
> > which case it will just ignore one.
> > Attached patch fixes this.
> > In addition I would also suggest replacing all those "goto bail_out;" by
> > "return NULL" since they both do the same - while I gotos have their
> > use, I think in this case they are useless and confusing.
> > 
> > Greetings,
> > Reimar D?ffinger
> 
> > Index: libavformat/dvenc.c
> > ===================================================================
> > --- libavformat/dvenc.c	(revision 9003)
> > +++ libavformat/dvenc.c	(working copy)
> > @@ -298,9 +298,11 @@
> >      for (i=0; i<s->nb_streams; i++) {
> >           switch (s->streams[i]->codec->codec_type) {
> >           case CODEC_TYPE_VIDEO:
> > +             if (vst) return NULL; 
> >                 vst = s->streams[i];
> 
> trailing whitespace and the indention is wrong (and yes iam aware that
> the existing code is also inconsistently indented but yours has 13 spaces
> which considering consistent indention would either be indented by 1 level
> of 13 spaces or 13 levels of 1 space ...)

I just went with the one CODEC_TYPE_AUDIO used, assuming it made sense...

> actual patch appoval/rejection left to our dv maintainer roman

I can also more easily send an indentation-consistent one if he makes
the existing indentation consistent first ;-).

Greetings,
Reimar D?ffinger




More information about the ffmpeg-devel mailing list