1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-24 13:56:33 +02:00

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2015-05-05 22:01:58 +02:00
parent 984f50deb2
commit 5a455dd011

View File

@ -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) {