Commit cb222d73 authored by James Almer's avatar James Almer

Merge commit 'b2788fe9'

* commit 'b2788fe9':
  svq3: fix the slice size check
Merged-by: 's avatarJames Almer <jamrial@gmail.com>
parents d17a0037 b2788fe9
......@@ -1036,17 +1036,16 @@ static int svq3_decode_slice_header(AVCodecContext *avctx)
slice_bits = slice_length * 8;
slice_bytes = slice_length + length - 1;
if (8LL*slice_bytes > get_bits_left(&s->gb)) {
av_log(avctx, AV_LOG_ERROR, "slice after bitstream end\n");
return -1;
}
skip_bits(&s->gb, 8);
av_fast_malloc(&s->slice_buf, &s->slice_size, slice_bytes + AV_INPUT_BUFFER_PADDING_SIZE);
if (!s->slice_buf)
return AVERROR(ENOMEM);
if (slice_bytes * 8LL > get_bits_left(&s->gb)) {
av_log(avctx, AV_LOG_ERROR, "slice after bitstream end\n");
return AVERROR_INVALIDDATA;
}
memcpy(s->slice_buf, s->gb.buffer + s->gb.index / 8, slice_bytes);
init_get_bits(&s->gb_slice, s->slice_buf, slice_bits);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment