[FFmpeg-devel] [PATCH 3/4] avcodec/vp568: Check that there is enough data for ff_vp56_init_range_decoder()
Ronald S. Bultje
rsbultje at gmail.com
Tue Mar 7 15:35:33 EET 2017
Hi,
On Mon, Mar 6, 2017 at 8:41 PM, Michael Niedermayer <michael at niedermayer.cc>
wrote:
> -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;
> }
Isn't this AV_INPUT_BUFFER_PADDING_SIZE?
And this is inconsistent with the silent failure in renorm().
Ronald
More information about the ffmpeg-devel
mailing list