diff --git a/vp9/decoder/vp9_decodframe.c b/vp9/decoder/vp9_decodframe.c index d9fd77c8aaf99ef4e584330621644e0c5f88363f..1342b31f8cb82d269aa14f549cdcb2e56068353e 100644 --- a/vp9/decoder/vp9_decodframe.c +++ b/vp9/decoder/vp9_decodframe.c @@ -973,7 +973,7 @@ static void check_sync_code(VP9_COMMON *cm, struct vp9_read_bit_buffer *rb) { } } -static void error_handler(void *data, int bit_offset) { +static void error_handler(void *data, size_t bit_offset) { VP9_COMMON *const cm = (VP9_COMMON *)data; vpx_internal_error(&cm->error, VPX_CODEC_CORRUPT_FRAME, "Truncated packet"); } diff --git a/vp9/decoder/vp9_read_bit_buffer.h b/vp9/decoder/vp9_read_bit_buffer.h index 220056862b3feeccf16e794b78f4be92ef020e8c..f243cb451ecff7de48aaa41b2ee7d2e70fb4c1b5 100644 --- a/vp9/decoder/vp9_read_bit_buffer.h +++ b/vp9/decoder/vp9_read_bit_buffer.h @@ -15,7 +15,7 @@ #include "vpx/vpx_integer.h" -typedef void (*vp9_rb_error_handler)(void *data, int bit_offset); +typedef void (*vp9_rb_error_handler)(void *data, size_t bit_offset); struct vp9_read_bit_buffer { const uint8_t *bit_buffer; @@ -31,9 +31,9 @@ static size_t vp9_rb_bytes_read(struct vp9_read_bit_buffer *rb) { } static int vp9_rb_read_bit(struct vp9_read_bit_buffer *rb) { - const int off = rb->bit_offset; - const int p = off / CHAR_BIT; - const int q = CHAR_BIT - 1 - off % CHAR_BIT; + const size_t off = rb->bit_offset; + const size_t p = off / CHAR_BIT; + const int q = CHAR_BIT - 1 - (int)off % CHAR_BIT; if (rb->bit_buffer + p >= rb->bit_buffer_end) { rb->error_handler(rb->error_handler_data, rb->bit_offset); return 0;