On Fri, 06 Jul 2012 19:13:14 -0400, Justin Ruggles <[email protected]> 
wrote:
> On 07/06/2012 04:41 PM, Anton Khirnov wrote:
> > This way we don't end with an invalid stream if parsing the picture
> > fails.
> > ---
> >  libavformat/flacdec.c |    8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> > 
> > diff --git a/libavformat/flacdec.c b/libavformat/flacdec.c
> > index f481c10..ebd4a49 100644
> > --- a/libavformat/flacdec.c
> > +++ b/libavformat/flacdec.c
> > @@ -38,10 +38,6 @@ static int parse_picture(AVFormatContext *s, uint8_t 
> > *buf, int buf_size)
> >      int type, width, height;
> >      int len, ret = 0;
> >  
> > -    st = avformat_new_stream(s, NULL);
> > -    if (!st)
> > -        return AVERROR(ENOMEM);
> > -
> >      pb = avio_alloc_context(buf, buf_size, 0, NULL, NULL, NULL, NULL);
> >      if (!pb)
> >          return AVERROR(ENOMEM);
> > @@ -111,6 +107,10 @@ static int parse_picture(AVFormatContext *s, uint8_t 
> > *buf, int buf_size)
> >      }
> >      if (avio_read(pb, data, len) != len) {
> >          ret = AVERROR(EIO);
> > +
> > +    st = avformat_new_stream(s, NULL);
> > +    if (!st) {
> > +        ret = AVERROR(ENOMEM);
> >          goto fail;
> >      }
> >  
> 
> That doesn't look right. The existing if() block has an opening brace
> that isn't closed after the patch. Unless I'm completely missing
> something here...
> 

Meh, I fail at git add -p. The missing brace is added in 2/3.

-- 
Anton Khirnov
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to