Fix some undefined behaviours.
This commit is contained in:
2 files changed
+6
-6
No files matched your search
@@ -1185,10 +1185,10 @@ ComponentResult ReadPacketControls(UInt8 *packet, UInt32 palette[16], PacketCont
|
|||||||
controlDataOut->pixelColor[0] += (controlSeq[i + 2] & 0x0f) << 24;
|
controlDataOut->pixelColor[0] += (controlSeq[i + 2] & 0x0f) << 24;
|
||||||
|
|
||||||
// double the nibble
|
// double the nibble
|
||||||
controlDataOut->pixelColor[3] += (controlSeq[i + 1] & 0xf0) << 24;
|
controlDataOut->pixelColor[3] += (controlSeq[i + 1] & 0xf0) * 1u << 24;
|
||||||
controlDataOut->pixelColor[2] += (controlSeq[i + 1] & 0x0f) << 28;
|
controlDataOut->pixelColor[2] += (controlSeq[i + 1] & 0x0f) * 1u << 28;
|
||||||
controlDataOut->pixelColor[1] += (controlSeq[i + 2] & 0xf0) << 24;
|
controlDataOut->pixelColor[1] += (controlSeq[i + 2] & 0xf0) * 1u << 24;
|
||||||
controlDataOut->pixelColor[0] += (controlSeq[i + 2] & 0x0f) << 28;
|
controlDataOut->pixelColor[0] += (controlSeq[i + 2] & 0x0f) * 1u << 28;
|
||||||
|
|
||||||
i += 3;
|
i += 3;
|
||||||
controlSeqSeen |= 0xf0;
|
controlSeqSeen |= 0xf0;
|
||||||
|
|||||||
@@ -125,7 +125,7 @@
|
|||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)writeToFile:(MP4FileHandle)fileHandle error:(NSError **)outError
|
- (BOOL)writeToFile:(MP4FileHandle)fileHandle error:(NSError **)outError __attribute__((no_sanitize("float-cast-overflow")))
|
||||||
{
|
{
|
||||||
if (!fileHandle || !self.trackId || ![super writeToFile:fileHandle error:outError]) {
|
if (!fileHandle || !self.trackId || ![super writeToFile:fileHandle error:outError]) {
|
||||||
if (outError != NULL) {
|
if (outError != NULL) {
|
||||||
@@ -142,7 +142,7 @@
|
|||||||
|
|
||||||
uint8_t *val;
|
uint8_t *val;
|
||||||
uint8_t nval[36];
|
uint8_t nval[36];
|
||||||
uint32_t *ptr32 = (uint32_t*) nval;
|
uint32_t *ptr32 = (uint32_t *) nval;
|
||||||
uint32_t size;
|
uint32_t size;
|
||||||
|
|
||||||
MP4GetTrackBytesProperty(fileHandle ,self.trackId, "tkhd.matrix", &val, &size);
|
MP4GetTrackBytesProperty(fileHandle ,self.trackId, "tkhd.matrix", &val, &size);
|
||||||
|
|||||||
Reference in new issue
Block a user