[FFmpeg-devel] [PATCH] lavf: add subfile protocol.

Nicolas George george at nsup.org
Thu Feb 27 20:26:58 CET 2014


Le nonidi 9 ventôse, an CCXXII, Lukasz M a écrit :
>    p = lseek(fh, -2, SEEK_SET);

> depends on unistd.h being included / not included

My guess: you are on x86_64, without unistd.h, -2 is considered an integer
and stored into ESI, but the libc/system call expects the 64 bits offset to
be in RSI. Therefore, your 32-bits -2 is expanded to 64 bits using whatever
happened to be left in RSI's most significant bits, probably 0 for such a
sort program. Therefore, you are seeking to 4294967294, which is legal.

You can confirm using strace. That is what I tested:

strace -e lseek perl -e 'seek STDIN, -2, 0' < ~/TODO

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140227/1ab42dda/attachment.asc>


More information about the ffmpeg-devel mailing list