[FFmpeg-cvslog] af_pan: comment a tricky piece of code.

Nicolas George nicolas.george at normalesup.org
Thu Feb 16 13:26:44 CET 2012


Le septidi 27 pluviôse, an CCXX, Reimar Döffinger a écrit :
> If we ever used all 64 bits, (int64_t)1 << channel_id would actually be
> a signed overflow.

Actually, only if the 63rd bit is the only one set. And the 63rd bit is
already a reserved value (AV_CH_LAYOUT_NATIVE), and a layout with that flag
can not possibly be returned by av_get_channel_layout. So in this case, we
are safe.

Furthermore, the integer overflow would only happen to compare the result
with a value that would have suffered the same overflow: would it be a
problem?

In other words: is there any known supported architecture where signed
integer overflows are actually a problem by themselves (as opposed as:
because the result is unexpectedly negative)? Or, for that matter, where
signed integer overflows are anything else than 2's complement?

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-cvslog/attachments/20120216/a6d4e52c/attachment.asc>


More information about the ffmpeg-cvslog mailing list