Skip to content
Snippets Groups Projects

araw: fix overflows in 24-bit decoder

Merged Rémi Denis-Courmont requested to merge Courmisch/vlc:araw into 3.0.x

The high-order byte is promoted to 'int'. If the high-order bit is set, this results in an overflow (into the sign bit) when shifted by 24 bits to the left. This was flagged by the UB sanitiser. To fix that, promote all bytes to 32-bit unsigned first, to perform overflow-proof unsigned arithmetic.

Then to avoid aliasing errors, make sure the output is written as signed 32-bit values, since the decoder outputs S32N.

(cherry picked from commit 9260acab)

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading