]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/bitstream.c
mlpdec: Validate non-restart bit from the substream header.
[ffmpeg] / libavcodec / bitstream.c
index 57f139138eb4c3ffdbdeafd288de9b562d522c5e..5d9bd32707d8b6ebdbbd7863a63e95bba7186b57 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Common bit i/o utils
- * Copyright (c) 2000, 2001 Fabrice Bellard.
+ * Copyright (c) 2000, 2001 Fabrice Bellard
  * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
  *
  * alternative bitstream reader & writer by Michael Niedermayer <michaelni@gmx.at>
@@ -23,7 +23,7 @@
  */
 
 /**
- * @file bitstream.c
+ * @file libavcodec/bitstream.c
  * bitstream api.
  */
 
@@ -37,6 +37,7 @@ const uint8_t ff_log2_run[32]={
  8, 9,10,11,12,13,14,15
 };
 
+#if LIBAVCODEC_VERSION_MAJOR < 53
 /**
  * Same as av_mallocz_static(), but does a realloc.
  *
@@ -53,6 +54,7 @@ static void *ff_realloc_static(void *ptr, unsigned int size)
 {
     return av_realloc(ptr, size);
 }
+#endif
 
 void align_put_bits(PutBitContext *s)
 {
@@ -82,8 +84,8 @@ void ff_copy_bits(PutBitContext *pb, const uint8_t *src, int length)
 
     if(length==0) return;
 
-    if(ENABLE_SMALL || words < 16 || put_bits_count(pb)&7){
-        for(i=0; i<words; i++) put_bits(pb, 16, be2me_16(srcw[i]));
+    if(CONFIG_SMALL || words < 16 || put_bits_count(pb)&7){
+        for(i=0; i<words; i++) put_bits(pb, 16, AV_RB16(&srcw[i]));
     }else{
         for(i=0; put_bits_count(pb)&31; i++)
             put_bits(pb, 8, src[i]);
@@ -92,7 +94,7 @@ void ff_copy_bits(PutBitContext *pb, const uint8_t *src, int length)
         skip_put_bytes(pb, 2*words-i);
     }
 
-    put_bits(pb, bits, be2me_16(srcw[words])>>(16-bits));
+    put_bits(pb, bits, AV_RB16(&srcw[words])>>(16-bits));
 }
 
 /* VLC decoding */