shithub: openh264

Download patch

ref: 6854e06796aa285c4d22f0e10489d511f9e5f9e2
parent: c9a25e949479f7b7dc732706bedd28dbbf47017f
parent: d5e0b9937285e3632f096e17c126193e6725dd55
author: Licai Guo <[email protected]>
date: Mon Feb 24 09:34:46 EST 2014

Merge pull request #343 from huili2/cast_get_word

cast to uint32_t in GET_WORD to prevent possible left shift error.

--- a/codec/decoder/core/inc/dec_golomb.h
+++ b/codec/decoder/core/inc/dec_golomb.h
@@ -57,7 +57,7 @@
   if (iReadBytes > iAllowedBytes+1) { \
     return ERR_INFO_READ_OVERFLOW; \
   } \
-	iCurBits |= ((pBufPtr[0] << 8) | pBufPtr[1]) << (iLeftBits); \
+	iCurBits |= ((uint32_t)((pBufPtr[0] << 8) | pBufPtr[1])) << (iLeftBits); \
 	iLeftBits -= 16; \
 	pBufPtr +=2; \
 }