You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
MK(BE)TAG: avoid undefined shifts
Casting the left-most byte to unsigned avoids an undefined result of the shift by 24 if bit 7 is set. This affects the rm demuxer. Signed-off-by: Mans Rullgard <mans@mansr.com>
This commit is contained in:
@@ -218,8 +218,8 @@ static av_always_inline av_const int av_popcount_c(uint32_t x)
|
|||||||
return (x + (x >> 16)) & 0x3F;
|
return (x + (x >> 16)) & 0x3F;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MKTAG(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | ((d) << 24))
|
#define MKTAG(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | ((unsigned)(d) << 24))
|
||||||
#define MKBETAG(a,b,c,d) ((d) | ((c) << 8) | ((b) << 16) | ((a) << 24))
|
#define MKBETAG(a,b,c,d) ((d) | ((c) << 8) | ((b) << 16) | ((unsigned)(a) << 24))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert a UTF-8 character (up to 4 bytes) to its 32-bit UCS-4 encoded form.
|
* Convert a UTF-8 character (up to 4 bytes) to its 32-bit UCS-4 encoded form.
|
||||||
|
Reference in New Issue
Block a user