Merge commit '096abfa15052977eed93f0b5e01afd2d47c53c1f'

* commit '096abfa15052977eed93f0b5e01afd2d47c53c1f':
  parser: fix large overreads
  bitstream: add get_bits64() to support reading more than 32 bits at once
  arm: detect cpu features at runtime on Linux

Conflicts:
	libavcodec/parser.c
	libavformat/mpegts.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer
2012-12-08 14:58:56 +01:00
5 changed files with 95 additions and 18 deletions
+5 -5
View File
@@ -322,15 +322,15 @@ static inline unsigned int get_bits_long(GetBitContext *s, int n)
*/
static inline uint64_t get_bits64(GetBitContext *s, int n)
{
if (n <= 32)
if (n <= 32) {
return get_bits_long(s, n);
else {
} else {
#ifdef BITSTREAM_READER_LE
uint64_t ret = get_bits_long(s, 32);
return ret | (((uint64_t)get_bits_long(s, n-32)) << 32);
return ret | (uint64_t)get_bits_long(s, n - 32) << 32;
#else
uint64_t ret = ((uint64_t)get_bits_long(s, 32)) << (n-32);
return ret | get_bits_long(s, n-32);
uint64_t ret = (uint64_t)get_bits_long(s, n - 32) << 32;
return ret | get_bits_long(s, 32);
#endif
}
}