Commit 5a455dd0 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/diracdec: Move buf[] read after size check

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 984f50de
......@@ -1815,12 +1815,14 @@ static int dirac_decode_data_unit(AVCodecContext *avctx, const uint8_t *buf, int
{
DiracContext *s = avctx->priv_data;
DiracFrame *pic = NULL;
int ret, i, parse_code = buf[4];
int ret, i, parse_code;
unsigned tmp;
if (size < DATA_UNIT_HEADER_SIZE)
return -1;
parse_code = buf[4];
init_get_bits(&s->gb, &buf[13], 8*(size - DATA_UNIT_HEADER_SIZE));
if (parse_code == pc_seq_header) {
......
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