Re: [libav-devel] [PATCH] Checked get_bits.h functions to prevent overread

2011-09-09 Thread Alex Converse
On Fri, Sep 9, 2011 at 10:47 AM, Jason Garrett-Glaser wrote: > On Fri, Sep 9, 2011 at 8:29 AM, Alex Converse wrote: >> On Fri, Sep 9, 2011 at 6:09 AM, Janne Grunau wrote: >>> On Fri, Sep 09, 2011 at 11:04:59AM +0100, Måns Rullgård wrote: Alex Converse writes: > i.e. Please turn t

Re: [libav-devel] [PATCH] Checked get_bits.h functions to prevent overread

2011-09-09 Thread Jason Garrett-Glaser
On Fri, Sep 9, 2011 at 8:29 AM, Alex Converse wrote: > On Fri, Sep 9, 2011 at 6:09 AM, Janne Grunau wrote: >> On Fri, Sep 09, 2011 at 11:04:59AM +0100, Måns Rullgård wrote: >>> Alex Converse writes: >>> >>> > i.e. Please turn this feature on for the Indeos and the Sorensons and >>> > the like, b

Re: [libav-devel] [PATCH] Checked get_bits.h functions to prevent overread

2011-09-09 Thread Måns Rullgård
Janne Grunau writes: > On Fri, Sep 09, 2011 at 11:04:59AM +0100, Måns Rullgård wrote: >> Alex Converse writes: >> >> > i.e. Please turn this feature on for the Indeos and the Sorensons and >> > the like, but let's fix the individual bugs in the H.264s and VP8s. >> > Turning this on for them is

Re: [libav-devel] [PATCH] Checked get_bits.h functions to prevent overread

2011-09-09 Thread Alex Converse
On Fri, Sep 9, 2011 at 6:09 AM, Janne Grunau wrote: > On Fri, Sep 09, 2011 at 11:04:59AM +0100, Måns Rullgård wrote: >> Alex Converse writes: >> >> > i.e. Please turn this feature on for the Indeos and the Sorensons and >> > the like, but let's fix the individual bugs in the H.264s and VP8s. >> >

Re: [libav-devel] [PATCH] Checked get_bits.h functions to prevent overread

2011-09-09 Thread Janne Grunau
On Fri, Sep 09, 2011 at 11:04:59AM +0100, Måns Rullgård wrote: > Alex Converse writes: > > > i.e. Please turn this feature on for the Indeos and the Sorensons and > > the like, but let's fix the individual bugs in the H.264s and VP8s. > > Turning this on for them is overkill. > > Agree. This wi

Re: [libav-devel] [PATCH] Checked get_bits.h functions to prevent overread

2011-09-09 Thread Måns Rullgård
Alex Converse writes: > On Thu, Sep 8, 2011 at 4:05 PM, Laurent Aimar wrote: >> Hi, >> >>  After trying some fuzzing on libavcodec, it seems that a lot of decoders >> does not check (or not enough) for buffer overread which can lead for some >> to a segfault. >> >>  I attached a patch that make

Re: [libav-devel] [PATCH] Checked get_bits.h functions to prevent overread

2011-09-09 Thread Laurent Aimar
On Fri, Sep 09, 2011 at 09:55:47AM +0200, Diego Biurrun wrote: > On Thu, Sep 08, 2011 at 05:38:37PM -0700, Alex Converse wrote: > > On Thu, Sep 8, 2011 at 4:05 PM, Laurent Aimar wrote: > > > @@ -172,10 +184,18 @@ static inline int get_bits_count(const > > > GetBitContext *s){ > > > > > > static

Re: [libav-devel] [PATCH] Checked get_bits.h functions to prevent overread

2011-09-09 Thread Diego Biurrun
On Thu, Sep 08, 2011 at 05:38:37PM -0700, Alex Converse wrote: > On Thu, Sep 8, 2011 at 4:05 PM, Laurent Aimar wrote: > > @@ -172,10 +184,18 @@ static inline int get_bits_count(const GetBitContext > > *s){ > > > > static inline void skip_bits_long(GetBitContext *s, int n){ > > s->index += n

Re: [libav-devel] [PATCH] Checked get_bits.h functions to prevent overread

2011-09-08 Thread Kostya Shishkov
On Fri, Sep 09, 2011 at 01:05:54AM +0200, Laurent Aimar wrote: > Hi, > > After trying some fuzzing on libavcodec, it seems that a lot of decoders > does not check (or not enough) for buffer overread which can lead for some > to a segfault. > > I attached a patch that make get_bits.h function ch

Re: [libav-devel] [PATCH] Checked get_bits.h functions to prevent overread

2011-09-08 Thread Ronald S. Bultje
Hi, On Thu, Sep 8, 2011 at 6:06 PM, Alex Converse wrote: > This is a very expensive form of error resilience and there are a lot > of use cases where people just don't care. They will tolerate the SEGV > on the occasional bad file if it means they can decode a good with > reasonable speed. We ca

Re: [libav-devel] [PATCH] Checked get_bits.h functions to prevent overread

2011-09-08 Thread Alex Converse
On Thu, Sep 8, 2011 at 4:05 PM, Laurent Aimar wrote: > Hi, > >  After trying some fuzzing on libavcodec, it seems that a lot of decoders > does not check (or not enough) for buffer overread which can lead for some > to a segfault. > >  I attached a patch that make get_bits.h function checked for o

Re: [libav-devel] [PATCH] Checked get_bits.h functions to prevent overread

2011-09-08 Thread Alex Converse
On Thu, Sep 8, 2011 at 4:05 PM, Laurent Aimar wrote: > @@ -172,10 +184,18 @@ static inline int get_bits_count(const GetBitContext > *s){ > > static inline void skip_bits_long(GetBitContext *s, int n){ > s->index += n; > +#ifndef UNCHECK_BITSTREAM_READER > +if (s->index > s->size_in_bits

Re: [libav-devel] [PATCH] Checked get_bits.h functions to prevent overread

2011-09-08 Thread Ronald S. Bultje
Hi, On Thu, Sep 8, 2011 at 4:05 PM, Laurent Aimar wrote: >  I attached a patch that make get_bits.h function checked for overread by > default but let safe decoders disabling the checks at compilation time by > defining UNCHECK_BITSTREAM_READER before including get_bits.h. >  If such patch would

[libav-devel] [PATCH] Checked get_bits.h functions to prevent overread

2011-09-08 Thread Laurent Aimar
Hi, After trying some fuzzing on libavcodec, it seems that a lot of decoders does not check (or not enough) for buffer overread which can lead for some to a segfault. I attached a patch that make get_bits.h function checked for overread by default but let safe decoders disabling the checks at c