aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/msmpeg4.c
diff options
context:
space:
mode:
authorMåns Rullgård <mans@mansr.com>2010-08-24 15:40:57 +0000
committerMåns Rullgård <mans@mansr.com>2010-08-24 15:40:57 +0000
commitb3c1652b8208cd77fdc247a1cca9b07f03d63c10 (patch)
tree1c18da887244c0a1ed08016a891e3ffaf842670e /libavcodec/msmpeg4.c
parente2f402f160cf574cc69431f4a40a60078cf5e911 (diff)
downloadffmpeg-b3c1652b8208cd77fdc247a1cca9b07f03d63c10.tar.gz
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
Diffstat (limited to 'libavcodec/msmpeg4.c')
-rw-r--r--libavcodec/msmpeg4.c3
1 files changed, 1 insertions, 2 deletions
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;