diff options
author | Alex Converse <alex.converse@gmail.com> | 2010-08-24 16:10:25 +0000 |
---|---|---|
committer | Alex Converse <alex.converse@gmail.com> | 2010-08-24 16:10:25 +0000 |
commit | 4c399dc82b4e74f7b9d09c51ab3314dd68a1fdab (patch) | |
tree | 5cde500eacc59aba3b62d8544b2c7c63c6e352b3 /libavcodec/qdm2.c | |
parent | 37b9706123ff76455d4feb126897b9b5fb7cff69 (diff) | |
download | ffmpeg-4c399dc82b4e74f7b9d09c51ab3314dd68a1fdab.tar.gz |
Fix undefined expressions that use multiple calls to get_bits().
Because the order of evaluation of subexpressions is undefined, two
get_bits() calls may not be part of the same expression.
See also r24902.
Originally committed as revision 24906 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/qdm2.c')
-rw-r--r-- | libavcodec/qdm2.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c index 87dd0717e8..8b28c2d0f0 100644 --- a/libavcodec/qdm2.c +++ b/libavcodec/qdm2.c @@ -1209,7 +1209,8 @@ static void qdm2_decode_super_block (QDM2Context *q) init_get_bits(&gb, header.data, header.size*8); if (header.type == 2 || header.type == 4 || header.type == 5) { - int csum = 257 * get_bits(&gb, 8) + 2 * get_bits(&gb, 8); + int csum = 257 * get_bits(&gb, 8); + csum += 2 * get_bits(&gb, 8); csum = qdm2_packet_checksum(q->compressed_data, q->checksum_size, csum); |