]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/lagarithrac.h
avcodec/exrdsp: improve the ExrDSPContext->reorder_pixels prototype
[ffmpeg] / libavcodec / lagarithrac.h
index dfdfea0db38e43928281ea707279139d3ef43324..ee836d01db46ff5c48f90e26ca14f919778c517e 100644 (file)
@@ -47,6 +47,9 @@ typedef struct lag_rac {
     const uint8_t *bytestream;        /**< Current position in input bytestream. */
     const uint8_t *bytestream_end;    /**< End position of input bytestream. */
 
+    int overread;
+#define MAX_OVERREAD 4
+
     uint32_t prob[258];         /**< Table of cumulative probability for each symbol. */
     uint8_t  range_hash[1024];   /**< Hash table mapping upper byte to approximate symbol. */
 } lag_rac;
@@ -62,6 +65,8 @@ static inline void lag_rac_refill(lag_rac *l)
         l->low |= 0xff & (AV_RB16(l->bytestream) >> 1);
         if (l->bytestream < l->bytestream_end)
             l->bytestream++;
+        else
+            l->overread++;
     }
 }