[FFmpeg-devel] [libav-devel] [PATCH 5/8] Reject audio tracks with invalid interleaver parameters in RM demuxer.

Michael Niedermayer michaelni at gmx.at
Tue Sep 20 00:27:49 CEST 2011


On Sat, Sep 17, 2011 at 10:32:39PM +0200, Laurent Aimar wrote:
> On Sat, Sep 17, 2011 at 09:49:04PM +0200, Laurent Aimar wrote:
> > On Sat, Sep 17, 2011 at 04:56:33PM +0200, fenrir at elivagar.org wrote:
> > > From: Laurent Aimar <fenrir at videolan.org>
> > > 
> > > ---
> > >  libavformat/rmdec.c |   10 ++++++----
> > >  1 files changed, 6 insertions(+), 4 deletions(-)
> > > 
> > > diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
> > > index 1c96573..81f563e 100644
> > > --- a/libavformat/rmdec.c
> > > +++ b/libavformat/rmdec.c
> > > @@ -215,8 +215,9 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVIOContext *pb,
> > >              ast->audio_framesize = st->codec->block_align;
> > >              st->codec->block_align = coded_framesize;
> > >  
> > > -            if(ast->audio_framesize >= UINT_MAX / sub_packet_h){
> > > -                av_log(s, AV_LOG_ERROR, "ast->audio_framesize * sub_packet_h too large\n");
> > > +            if (ast->audio_framesize <= 0 || sub_packet_h <= 0 ||
> > > +                ast->audio_framesize >= UINT_MAX / sub_packet_h){
> > > +                av_log(s, AV_LOG_ERROR, "ast->audio_framesize * sub_packet_h is invalid\n");
> > >                  return -1;
> > >              }
> > >  
> > > @@ -252,8 +253,9 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVIOContext *pb,
> > >              if ((ret = rm_read_extradata(pb, st->codec, codecdata_length)) < 0)
> > >                  return ret;
> > >  
> > > -            if(ast->audio_framesize >= UINT_MAX / sub_packet_h){
> > > -                av_log(s, AV_LOG_ERROR, "rm->audio_framesize * sub_packet_h too large\n");
> > > +            if (ast->audio_framesize <= 0 || sub_packet_h <= 0 ||
> > > +                ast->audio_framesize >= UINT_MAX / sub_packet_h){
> > > +                av_log(s, AV_LOG_ERROR, "rm->audio_framesize * sub_packet_h is invalid\n");
> > >                  return -1;
> > >              }
> > 
> > Withdrawn, I will merge it with:
> > - "Reject invalid deinterleaving parameters in the RM demuxer."
> > - "Prevent the RM demuxer from returning uninitialized AVPacket in case of corrupted streams."
> > it will be simpler/more logical.
> 
> Patch attached.
> 
> -- 
> fenrir

>  rmdec.c |   57 +++++++++++++++++++++++++++++++--------------------------
>  1 file changed, 31 insertions(+), 26 deletions(-)
> c086b5f0fbb01ad2a6fbf51a77f7d1748de95477  0001-Reject-invalid-deinterleaving-parameters-in-the-RM-d.patch
> From c0977288030a4d8fdc161a363538ca1d130e8f2c Mon Sep 17 00:00:00 2001
> From: Laurent Aimar <fenrir at videolan.org>
> Date: Sat, 17 Sep 2011 00:05:13 +0200
> Subject: [PATCH] Reject invalid deinterleaving parameters in the RM demuxer.

this has found its way into ffmpeg mainline

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

Let us carefully observe those good qualities wherein our enemies excel us
and endeavor to excel them, by avoiding what is faulty, and imitating what
is excellent in them. -- Plutarch
-------------- 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-devel/attachments/20110920/29a1c0b8/attachment.asc>


More information about the ffmpeg-devel mailing list