]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/utils: Fix undefined behavior in avpriv_toupper4
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 16 May 2014 00:06:00 +0000 (02:06 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 16 May 2014 01:13:27 +0000 (03:13 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/utils.c

index a06ded30c8f328e4da720d37201921311150dca4..94df4b78551fa9040f48a6dbc9d8aba8cc4b950a 100644 (file)
@@ -3454,7 +3454,7 @@ unsigned int avpriv_toupper4(unsigned int x)
     return av_toupper(x & 0xFF) +
           (av_toupper((x >>  8) & 0xFF) << 8)  +
           (av_toupper((x >> 16) & 0xFF) << 16) +
-          (av_toupper((x >> 24) & 0xFF) << 24);
+((unsigned)av_toupper((x >> 24) & 0xFF) << 24);
 }
 
 int ff_thread_ref_frame(ThreadFrame *dst, ThreadFrame *src)