[FFmpeg-cvslog] avcodec/utils: Fix undefined behavior in avpriv_toupper4

Michael Niedermayer git at videolan.org
Fri May 16 03:19:29 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri May 16 02:06:00 2014 +0200| [a071c0b515e5935b4e2d09899303f6d3c9fb158b] | committer: Michael Niedermayer

avcodec/utils: Fix undefined behavior in avpriv_toupper4

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a071c0b515e5935b4e2d09899303f6d3c9fb158b
---

 libavcodec/utils.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index a06ded3..94df4b7 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -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)



More information about the ffmpeg-cvslog mailing list