[MPlayer-dev-eng] [BUG][PATCH] uninitialized memory access in subreader.c

Ivan Kalvachev ikalvachev at gmail.com
Tue Jun 13 14:22:10 CEST 2006


2006/6/13, Guillaume Poirier <gpoirier at mplayerhq.hu>:
> Hi,
>
> Evgeniy Stepanov wrote:
>
> > This patches fix 2 separate problems in subreader.
> > The first is a pointer to an uninitialized value being passed to open_stream,
> > where it is used in comparison.
> > The second happens when subtitle file name is shorter then ".utf-8" - the
> > patch makes it obvious.
>
> What's up with this patch?

The first one is OK.
I would preffer DEMUXER_TYPE_UNKNOWN instead of plain 0, as this is
what the function sets to that variable (if it is not playlist) before
calling stream open full.

I don't mind the second one, but I think it is useless ATM.
The filename is guranteed to be more than 4 chars, this means 5 chars
at least, wihout counting the additinal zero byte. So even in the case
of the 6 char ".utf-8" the strcmp should work.



More information about the MPlayer-dev-eng mailing list