[XviD-devel] [BUG] Segfault with large fincr/fbase values

Adam Thayer krevnik at comcast.net
Wed Jul 14 14:52:36 CEST 2004


On Jul 14, 2004, at 12:27 AM, Christoph Lampert wrote:

>
> Hi Adam,
>
> as far as I know, the standard allows only 16bit values for fincr and
> fbase. So it's not a bug that XviD can't handle your values, but it's a
> bug that xvid crashes instead of failing in initialization with an
> "illegal values" message.

Which is what I am noting. I used the phrase 'unreasonably high 
values', which I hoped would convey the feeling of invalid values. 
Still, I don't think XviD should be failing quite this spectacularly, 
and should have done bounds checking at one of two points: fincr/fbase 
values, or the bitstream length. Checking at either one of these points 
would have stopped the failure.

> Btw, your values should be swapped, right? fbase is supposed to be 
> larger
> than fincr, because fps = fbase/fincr.

Well, either direction, XviD produced valid data with the right 
framerate. Since there wasn't enough documentation on how the frame 
rate fractional was supposed to be represented in either ffmpeg or XviD 
(without delving beyond headers), I went with ffmpeg's layout where fps 
= frame_rate/frame_rate_base. It produced an MP4 file that would be 
noticed with the proper frame rate. Although your method does the same. 
In this situation, a file setup so that fps = fbase/fincr causes 
mpeg4ip's tools to crash, while fps = fincr/fbase results in files 
mpeg4ip's tools read just fine. Curious.

> gruel



More information about the XviD-devel mailing list