Conversation
|
Development builds of 207c64f: The links work without a GitHub account. Artifacts expire after 90 days, and this comment follows the latest successful build. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Five commits, rebased onto
nativeafter the upstream merge. Starts as thevqa-error-typebranch and follows the types through the signatures and structs ittouches, so no line here spells
long.Four on-disk layout bugs
Each is 4 bytes per field on Win32 and 8 off it, so each breaks only on a 64-bit target.
Upstream added
static_asserts for two of them in 945e858, and those asserts fail on anyother compiler; these commits make them hold everywhere.
ChunkHeaderunsigned long, read withsizeof(chunk), so 16 bytes read where the file has 8uint32_t,static_assert(== 8)Fofflong *frame offset table read raw from FINF, where the file stores 32-bit offsetsuint32_t *VQAHeader#pragma packgated on_MSC_VER, plus twounsigned long: 56 bytes, asserted 42uint32_t, 42 on bothVQASN2Jlongin the SN2J ADPCM state: 20 bytes, asserted 12int32_t, 12 on bothREVERSE_LONGfollows touint32_t, andiff.hgains the<cstdint>it was relying ontransitively.
A 64-bit defect in the error path
VQA_SeekGroupdeclaredunsigned int rcinside alongreturning function, so anegative error widened as unsigned:
Every
< 0test on that result failed on a 64-bit build. Win32 lands on -1, which is whyit went unseen.
Signedness
The 26
VQAERR_defines becomeenum VQAErrorType : int32_t, and the functions returningthem say so. Frame numbers are unsigned now,
StopFrameincluded, and the 24 fieldsaround them follow.
Four stay signed because
-1is a live sentinel:LoopCache.MinandMax,LoopStartFrame0, and the drawersLastFrameNum. Their comparison sites test the sentinel instead of relying on-1reinterpreting as an impossible frame. The drawers isthe one that could not go unsigned at all:
VQA_CalcFramesSinceDrawnorders against it(
cur >= LastFrameNum) and tests its subtraction for negativity.Three
x < NumFrames - 1tests becamex + 1 < NumFrames. The old signed types gave -1for a zero frame count and the test was false; unsigned subtraction would have wrapped to
0xFFFFFFFFand made it true. The additive form keeps the original answer for every framecount, checked exhaustively.
Verification
Nothing changes on the supported target:
longis 32 bits on Win32, so every field keepsits offset and width and both packed layouts keep the sizes they always had there. Both
Windows configurations are green.
No harness reaches these sources, so six
vqalibfiles were compiled here against astubbed
io.h:loader.cppdrops from 19 warnings to 14, andtask.cpp,drawer.cpp,buffer_.cppanddstream.cppsit exactly at theirnativecounts. Nothing added.audio.cppkeeps 2 errors, identical tonative, from theCallback1/Callback2function pointers assigned to
void *.No struct here is serialized and the library never writes, so there is no save or file
format to migrate.
Local: 20 harnesses unported as listed, 19 passing.