diff options
Diffstat (limited to 'gst-libs/ext/libav/libavcodec/lagarithrac.c')
-rw-r--r-- | gst-libs/ext/libav/libavcodec/lagarithrac.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gst-libs/ext/libav/libavcodec/lagarithrac.c b/gst-libs/ext/libav/libavcodec/lagarithrac.c index ab7a600..f85e012 100644 --- a/gst-libs/ext/libav/libavcodec/lagarithrac.c +++ b/gst-libs/ext/libav/libavcodec/lagarithrac.c @@ -32,15 +32,16 @@ void lag_rac_init(lag_rac *l, GetBitContext *gb, int length) { - int i, j; + int i, j, left; /* According to reference decoder "1st byte is garbage", * however, it gets skipped by the call to align_get_bits() */ align_get_bits(gb); + left = get_bits_left(gb) >> 3; l->bytestream_start = l->bytestream = gb->buffer + get_bits_count(gb) / 8; - l->bytestream_end = l->bytestream_start + length; + l->bytestream_end = l->bytestream_start + FFMIN(length, left); l->range = 0x80; l->low = *l->bytestream >> 1; |