[FFmpeg-cvslog] Make sure neither data_size nor sample_count is negative

Michael Niedermayer michaelni at gmx.at
Wed May 18 14:04:57 CEST 2011


On Wed, May 18, 2011 at 07:57:53AM +0200, Reimar Döffinger wrote:
> On 17 May 2011, at 22:26, git at videolan.org (Tomas Härdin) wrote:
> 
> > ffmpeg | branch: master | Tomas Härdin <tomas.hardin at codemill.se> | Tue May 17 19:52:36 2011 +0200| [3d922c84622e7bf8603390b154630c3d62b93b12] | committer: Michael Niedermayer
> > 
> > Make sure neither data_size nor sample_count is negative
> > 
> >> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3d922c84622e7bf8603390b154630c3d62b93b12
> > ---
> > 
> > libavformat/wav.c |    6 ++++++
> > 1 files changed, 6 insertions(+), 0 deletions(-)
> > 
> > diff --git a/libavformat/wav.c b/libavformat/wav.c
> > index 1832bc9..6b1e574 100644
> > --- a/libavformat/wav.c
> > +++ b/libavformat/wav.c
> > @@ -238,6 +238,12 @@ static int wav_read_header(AVFormatContext *s,
> >         avio_rl64(pb); /* RIFF size */
> >         data_size = avio_rl64(pb);
> >         sample_count = avio_rl64(pb);
> > +        if (data_size < 0 || sample_count < 0) {
> > +            av_log(s, AV_LOG_ERROR, "negative data_size and/or sample_count in "
> > +                   "ds64: data_size = %li, sample_count = %li\n",
> > +                   data_size, sample_count);
> > +            return AVERROR_INVALIDDATA;
> > +        }
> 
> Completely refusing to play the file seems a bit extreme for stuff that is not really necessary for playback.

feel free to chnage it
it would be nice to get such files for analysis though in case its
not just that one field that differs


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

Good people do not need laws to tell them to act responsibly, while bad
people will find a way around the laws. -- Plato
-------------- 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/20110518/fbd75c98/attachment.asc>


More information about the ffmpeg-cvslog mailing list