mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
Merge commit '9ae53c5860e17d087642d27b00dade071970a2e7'
* commit '9ae53c5860e17d087642d27b00dade071970a2e7': lavc: add ff_u8_to_s8() for safe type punning of uint8_t to int8_t Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
ac2fc63ac6
@ -224,4 +224,14 @@ static inline av_const unsigned int ff_sqrt(unsigned int a)
|
||||
return b - (a < b * b);
|
||||
}
|
||||
|
||||
static inline int8_t ff_u8_to_s8(uint8_t a)
|
||||
{
|
||||
union {
|
||||
uint8_t u8;
|
||||
int8_t s8;
|
||||
} b;
|
||||
b.u8 = a;
|
||||
return b.s8;
|
||||
}
|
||||
|
||||
#endif /* AVCODEC_MATHOPS_H */
|
||||
|
Loading…
Reference in New Issue
Block a user