[jitsi-dev] [jitsi/libjitsi] Fix possible byte conversion bug (#142)


#1

bytes in java are signed, and when you convert them to a
bigger type, like int, java perform what we call sign extension
and FF become FFFFFFFF before you shift (<<),
giving you unexpected result (compared to C)

Found using FindBugs
http://findbugs.sourceforge.net/bugDescriptions.html#BIT_ADD_OF_SIGNED_BYTE
http://findbugs.sourceforge.net/bugDescriptions.html#BIT_IOR_OF_SIGNED_BYTE

Signed-off-by: Etienne CHAMPETIER <champetier.etienne@gmail.com>
You can view, comment on, or merge this pull request online at:

  https://github.com/jitsi/libjitsi/pull/142

-- Commit Summary --

  * Fix possible byte conversion bug

-- File Changes --

    M src/org/jitsi/impl/neomedia/codec/REDBlockIterator.java (2)
    M src/org/jitsi/impl/neomedia/recording/SynchronizerImpl.java (2)
    M src/org/jitsi/impl/neomedia/transform/AbsSendTimeEngine.java (4)
    M src/org/jitsi/impl/neomedia/transform/REDTransformEngine.java (2)
    M src/org/jitsi/impl/neomedia/transform/rtcp/CompoundPacketEngine.java (2)
    M src/org/jitsi/sctp4j/SctpNotification.java (2)

-- Patch Links --

https://github.com/jitsi/libjitsi/pull/142.patch
https://github.com/jitsi/libjitsi/pull/142.diff

···

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jitsi/libjitsi/pull/142


#2

Merged #142.

···

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jitsi/libjitsi/pull/142#event-627800095