[FFmpeg-devel] Broken compile with latest libavutil/common.h
Michael Niedermayer
michaelni
Thu Jan 15 17:56:47 CET 2009
On Thu, Jan 15, 2009 at 02:37:56PM +0000, M?ns Rullg?rd wrote:
> Michael Niedermayer <michaelni at gmx.at> writes:
>
> > On Thu, Jan 15, 2009 at 12:43:27AM +0000, M?ns Rullg?rd wrote:
> >> Aurelien Jacobs <aurel at gnuage.org> writes:
> >> > +/**
> >> > + * converts fourcc string to int
> >> > + */
> >> > +static inline av_pure int ff_get_fourcc(const char *s){
> >> > + assert( strlen(s)==4 );
> >> > + return (s[0]) + (s[1]<<8) + (s[2]<<16) + (s[3]<<24);
> >> > +}
> >>
> >> This looks a lot like AV_RL32().
> >
> > indeed and i wouldnt mind seeing all ff_get_fourcc replaced by it
> >
> >> BTW, assert(strlen(s) ... ) is a
> >> stupid idea. If there's bad data, what's to say there will be a null
> >> terminator anywhere close?
> >
> > nothing, but if its not it will either segfault by reading to much
> > or the assert will end the program thus i dont see it as a problem.
>
> What if it doesn't hit unreadable memory, but hits a memory-mapped
> device where reads have side-effects?
good point even if i wouldnt consider this a very realistic scenario
but as the code can and should be replaced by direct use of AV_RL32() theres
little point in fixing this ...
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
There will always be a question for which you do not know the correct awnser.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090115/5ec25c73/attachment.pgp>
More information about the ffmpeg-devel
mailing list