From b3c1652b8208cd77fdc247a1cca9b07f03d63c10 Mon Sep 17 00:00:00 2001 From: Måns Rullgård Date: Tue, 24 Aug 2010 15:40:57 +0000 Subject: msmpeg4v1: fix undefined behaviour in msmpeg4_decode_picture_header() Because the order of evaluation of subexpressions is undefined, two get_bits() calls may not be part of the same expression. In this specific case, using get_bits_long() is simpler. This fixes msmpeg4v1 decoding with armcc. Originally committed as revision 24902 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/msmpeg4.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'libavcodec/msmpeg4.c') diff --git a/libavcodec/msmpeg4.c b/libavcodec/msmpeg4.c index 8b48dc7cd7..c54df7afa8 100644 --- a/libavcodec/msmpeg4.c +++ b/libavcodec/msmpeg4.c @@ -1395,8 +1395,7 @@ return -1; #endif if(s->msmpeg4_version==1){ - int start_code; - start_code = (get_bits(&s->gb, 16)<<16) | get_bits(&s->gb, 16); + int start_code = get_bits_long(&s->gb, 32); if(start_code!=0x00000100){ av_log(s->avctx, AV_LOG_ERROR, "invalid startcode\n"); return -1; -- cgit v1.2.3