]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/golomb.h
Use AC-3 as default codec for wtv.
[ffmpeg] / libavcodec / golomb.h
index 90eeb30b545d2c06410ee611f076632db2ce750a..d92bc40ee74e1a2b731e715a31d23647ac383c31 100644 (file)
@@ -75,6 +75,20 @@ static inline int get_ue_golomb(GetBitContext *gb){
     }
 }
 
+/**
+ * Read an unsigned Exp-Golomb code in the range 0 to UINT32_MAX-1.
+ */
+static inline unsigned get_ue_golomb_long(GetBitContext *gb)
+{
+    unsigned buf, log;
+
+    buf = show_bits_long(gb, 32);
+    log = 31 - av_log2(buf);
+    skip_bits_long(gb, log);
+
+    return get_bits_long(gb, log + 1) - 1;
+}
+
  /**
  * read unsigned exp golomb code, constraint to a max of 31.
  * the return value is undefined if the stored value exceeds 31.
@@ -288,6 +302,8 @@ static inline int get_ur_golomb_jpegls(GetBitContext *gb, int k, int limit, int
     }else{
         int i;
         for(i=0; SHOW_UBITS(re, gb, 1) == 0; i++){
+            if (get_bits_left(gb)<=0)
+                return -1;
             LAST_SKIP_BITS(re, gb, 1);
             UPDATE_CACHE(re, gb);
         }