Fix some undefined behaviours.

This commit is contained in:
Damiano Galassi committed 2017-09-14 13:22:00 +02:00
1 parent a707918ce0
commit 56ef707664
2 files changed
+6 -6

No files matched your search

+4 -4
View File
@@ -1185,10 +1185,10 @@ ComponentResult ReadPacketControls(UInt8 *packet, UInt32 palette[16], PacketCont
controlDataOut->pixelColor[0] += (controlSeq[i + 2] & 0x0f) << 24;
// double the nibble
controlDataOut->pixelColor[3] += (controlSeq[i + 1] & 0xf0) << 24;
controlDataOut->pixelColor[2] += (controlSeq[i + 1] & 0x0f) << 28;
controlDataOut->pixelColor[1] += (controlSeq[i + 2] & 0xf0) << 24;
controlDataOut->pixelColor[0] += (controlSeq[i + 2] & 0x0f) << 28;
controlDataOut->pixelColor[3] += (controlSeq[i + 1] & 0xf0) * 1u << 24;
controlDataOut->pixelColor[2] += (controlSeq[i + 1] & 0x0f) * 1u << 28;
controlDataOut->pixelColor[1] += (controlSeq[i + 2] & 0xf0) * 1u << 24;
controlDataOut->pixelColor[0] += (controlSeq[i + 2] & 0x0f) * 1u << 28;
i += 3;
controlSeqSeen |= 0xf0;
+2 -2
View File
@@ -125,7 +125,7 @@
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 (outError != NULL) {
@@ -142,7 +142,7 @@
uint8_t *val;
uint8_t nval[36];
uint32_t *ptr32 = (uint32_t*) nval;
uint32_t *ptr32 = (uint32_t *) nval;
uint32_t size;
MP4GetTrackBytesProperty(fileHandle ,self.trackId, "tkhd.matrix", &val, &size);