diff options
Diffstat (limited to 'media/ffvpx/libavcodec/vp56rac.c')
-rw-r--r-- | media/ffvpx/libavcodec/vp56rac.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/media/ffvpx/libavcodec/vp56rac.c b/media/ffvpx/libavcodec/vp56rac.c index 6061b7ee7..e70302bf8 100644 --- a/media/ffvpx/libavcodec/vp56rac.c +++ b/media/ffvpx/libavcodec/vp56rac.c @@ -37,11 +37,14 @@ const uint8_t ff_vp56_norm_shift[256]= { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, }; -void ff_vp56_init_range_decoder(VP56RangeCoder *c, const uint8_t *buf, int buf_size) +int ff_vp56_init_range_decoder(VP56RangeCoder *c, const uint8_t *buf, int buf_size) { c->high = 255; c->bits = -16; c->buffer = buf; c->end = buf + buf_size; + if (buf_size < 1) + return AVERROR_INVALIDDATA; c->code_word = bytestream_get_be24(&c->buffer); + return 0; } |