[FFmpeg-devel] [PATCH] dvdsubdec make pos values unsigned

Reimar Döffinger Reimar.Doeffinger
Sat Aug 15 02:15:21 CEST 2009

On Fri, Aug 14, 2009 at 02:14:21AM +0200, Michael Niedermayer wrote:
> On Thu, Aug 13, 2009 at 01:31:01PM +0200, Reimar D?ffinger wrote:
> > On Thu, Aug 13, 2009 at 01:25:20PM +0200, Reimar D?ffinger wrote:
> > > Hello,
> > > dvdsubdec reads 32 bit values into e.g. cmd_pos and then checks its
> > > validity with e.g.
> > > while ((cmd_pos + 2 + offset_size) < buf_size) {
> > > which obviously is not correct.
> > > I suggest the simplest fix of making these variables unsigned:
> > 
> > Forget that, that's almost as wrong.
> > This one I think works and is sufficient:
> ok


> do you maybe want to become maintainer of dvdsubdec ? 

Not as long as I'd have to work without any kind of regression testing.
Mike, could you add something to FATE like this (maybe you can reduce the
size of the samples by simply remuxing without video if necessary?):
ffmpeg -i http://samples.mplayerhq.hu/sub/NeroMP4/unsupported-embedded-subs-2.mp4 -an -vn -scodec xsub -f framecrc -
ffmpeg -i http://samples.mplayerhq.hu/sub/small.divx -an -av -scodec dvdsub -f framecrc

While it is a bit of an entangled mess it should test the DVD and XSUB de- and
Of course there is no hurry in adding these checks since first the code needs to be
The first command loses the first subtitle, the second one crashes.

More information about the ffmpeg-devel mailing list