mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-02-04 05:44:53 +00:00
[PR #1923] fix(mp4): Use fixed-width integer types in bswap functions #2723
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Original Pull Request: https://github.com/CCExtractor/ccextractor/pull/1923
State: closed
Merged: Yes
Summary
bswap16andbswap32to useint16_tandint32_tinstead ofshortandlongProblem
On Windows x64,
longis 4 bytes (LLP64 model), while on Linux x64longis 8 bytes (LP64 model). This type size difference in thebswap32function could cause inconsistent behavior when parsing NAL unit lengths in MP4/MOV files.When reading NAL lengths with
*(long *)&s->data[i]:This could potentially affect timestamp calculations and cause the timing differences observed between Windows and Linux CI tests.
Changes
bswap16shortint16_tbswap32longint32_tAll call sites in
process_avc_sample()andprocess_hevc_sample()updated accordingly.Test plan
🤖 Generated with Claude Code