[FFmpeg-cvslog] bit: replace assert() by proper check.

Michael Niedermayer michaelni at gmx.at
Sun Sep 25 12:22:14 CEST 2011


On Sun, Sep 25, 2011 at 11:13:03AM +0200, Reimar Döffinger wrote:
> 
> 
> On 25 Sep 2011, at 05:45, git at videolan.org (Michael Niedermayer) wrote:
> 
> > ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Sep 25 05:07:34 2011 +0200| [21922dc5aefa3b5a75420d6f444da6a14e352726] | committer: Michael Niedermayer
> > 
> > bit: replace assert() by proper check.
> > 
> > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> > 
> >> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=21922dc5aefa3b5a75420d6f444da6a14e352726
> > ---
> > 
> > libavformat/bit.c |    3 ++-
> > 1 files changed, 2 insertions(+), 1 deletions(-)
> > 
> > diff --git a/libavformat/bit.c b/libavformat/bit.c
> > index 114d23d..5fb3d55 100644
> > --- a/libavformat/bit.c
> > +++ b/libavformat/bit.c
> > @@ -72,7 +72,8 @@ static int read_packet(AVFormatContext *s,
> > 
> >     sync = get_le16(pb); // sync word
> >     packet_size = get_le16(pb) / 8;
> > -    assert(packet_size < 8 * MAX_FRAME_SIZE);
> > +    if(packet_size > MAX_FRAME_SIZE)
> > +        return AVERROR(EIO);
> 
> Not to be an annoyance, but shouldn't that be INVALIDDATA or such, and certainly not EIO?

changed

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Freedom in capitalist society always remains about the same as it was in
ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-cvslog/attachments/20110925/be0cb1cb/attachment.asc>


More information about the ffmpeg-cvslog mailing list