[FFmpeg-devel] [PATCH] lavf: add subfile protocol.
Lukasz Marek
lukasz.m.luki at gmail.com
Thu Feb 27 23:53:07 CET 2014
On 27.02.2014 20:26, Nicolas George wrote:
> 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
Indeed that's the reason, strace shows 4294967294 on 64 bit system in
this example code. Debian is 32bit.
Thanks!
--
Best Regards,
Lukasz Marek
You can avoid reality, but you cannot avoid the consequences of avoiding
reality. - Ayn Rand
More information about the ffmpeg-devel
mailing list