You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
avutil/common: Protect GET_BYTE in GET_UTF8() by ()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -356,13 +356,13 @@ static av_always_inline av_const int av_parity_c(uint32_t v)
|
|||||||
* to prevent undefined results.
|
* to prevent undefined results.
|
||||||
*/
|
*/
|
||||||
#define GET_UTF8(val, GET_BYTE, ERROR)\
|
#define GET_UTF8(val, GET_BYTE, ERROR)\
|
||||||
val= GET_BYTE;\
|
val= (GET_BYTE);\
|
||||||
{\
|
{\
|
||||||
uint32_t top = (val & 128) >> 1;\
|
uint32_t top = (val & 128) >> 1;\
|
||||||
if ((val & 0xc0) == 0x80 || val >= 0xFE)\
|
if ((val & 0xc0) == 0x80 || val >= 0xFE)\
|
||||||
ERROR\
|
ERROR\
|
||||||
while (val & top) {\
|
while (val & top) {\
|
||||||
int tmp= GET_BYTE - 128;\
|
int tmp= (GET_BYTE) - 128;\
|
||||||
if(tmp>>6)\
|
if(tmp>>6)\
|
||||||
ERROR\
|
ERROR\
|
||||||
val= (val<<6) + tmp;\
|
val= (val<<6) + tmp;\
|
||||||
|
Reference in New Issue
Block a user