[MPlayer-dev-eng] Sign extension bug in stream_read_qword_le

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Sun Aug 19 10:57:35 CEST 2007


Hello,
On Sun, Aug 19, 2007 at 02:00:31AM +0200, Sean Veers wrote:
> On 8/19/07, Reimar Döffinger wrote:
> > On Sun, Aug 19, 2007 at 12:30:41AM +0200, Sean Veers wrote:
> > > --- mplayer-1.0-rc1svn20070812/stream/stream.h  2007-08-12
> > > 11:49:30.000000000 +0200
> > > +++ mplayer-1.0-rc1svn20070812/stream/stream.h  2007-08-18
> > > 21:30:09.775666044 +0200
> > > @@ -189,7 +189,7 @@ inline static uint64_t stream_read_qword_le
> > >    y = stream_read_char(s);
> > >    y|=stream_read_char(s)<<8;
> > >    y|=stream_read_char(s)<<16;
> > > -  y|=stream_read_char(s)<<24;
> > > +  y|=(uint32_t)stream_read_char(s)<<24;
> > >    y|=(uint64_t)stream_read_char(s)<<32;
> > >    y|=(uint64_t)stream_read_char(s)<<40;
> > >    y|=(uint64_t)stream_read_char(s)<<48;
> >
> > I'd propose replacing this by
> > return stream_read_dword_le(s) | ((uint64_t)stream_read_dword_le(s) <<
> > 32);
> >
> > (untested though).
> > Or the same with keeping y if you consider it more readable.
> >
> 
> Thanks, revised and tested patch attached.

Applied.

Greetings,
Reimar Doeffinger



More information about the MPlayer-dev-eng mailing list