# HG changeset patch # User mru # Date 1282664457 0 # Node ID 7c9d711a4201826da4850f2498c3e5e66acdff6b # Parent 7cf900245fce6ef471cdf14a75295918bced2d1a 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. diff -r 7cf900245fce -r 7c9d711a4201 msmpeg4.c --- a/msmpeg4.c Tue Aug 24 15:21:27 2010 +0000 +++ b/msmpeg4.c Tue Aug 24 15:40:57 2010 +0000 @@ -1395,8 +1395,7 @@ #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;