[Ffmpeg-devel] Re: [PATCH] MXF demuxer

Uoti Urpala uoti.urpala
Tue Jul 18 00:48:44 CEST 2006


On Tue, 2006-07-18 at 00:39 +0200, Baptiste Coudurier wrote:
> >> +    if (type) { /* long form */
> >> +        int bytes_num = length & 0x7f;
> >> +        /* SMPTE 379M 5.3.4 guarantee that bytes_num must not exceed 8 bytes */
> >> +        assert(bytes_num <= 8);
> > 
> > using assert() to check stuff from a stream for validity is unacceptable
> > its like printf() aborting your application due to a spelling error
> 
> I assume bytes_num is <= 8. then It will overflow size. It's a
> "security" issue. I'll use av_assert.

If the file contains values not allowed by the spec you should diagnose
that as invalid input and return an error. It's not reasonable to assume
that the user would demux "trusted" files only, and so killing the
program because of invalid input is not appropriate.





More information about the ffmpeg-devel mailing list