You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avcodec/diracdec: Move buf[] read after size check
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -1815,12 +1815,14 @@ static int dirac_decode_data_unit(AVCodecContext *avctx, const uint8_t *buf, int
|
|||||||
{
|
{
|
||||||
DiracContext *s = avctx->priv_data;
|
DiracContext *s = avctx->priv_data;
|
||||||
DiracFrame *pic = NULL;
|
DiracFrame *pic = NULL;
|
||||||
int ret, i, parse_code = buf[4];
|
int ret, i, parse_code;
|
||||||
unsigned tmp;
|
unsigned tmp;
|
||||||
|
|
||||||
if (size < DATA_UNIT_HEADER_SIZE)
|
if (size < DATA_UNIT_HEADER_SIZE)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
parse_code = buf[4];
|
||||||
|
|
||||||
init_get_bits(&s->gb, &buf[13], 8*(size - DATA_UNIT_HEADER_SIZE));
|
init_get_bits(&s->gb, &buf[13], 8*(size - DATA_UNIT_HEADER_SIZE));
|
||||||
|
|
||||||
if (parse_code == pc_seq_header) {
|
if (parse_code == pc_seq_header) {
|
||||||
|
Reference in New Issue
Block a user