forked from FFmpeg/FFmpeg
avcodec/escape130: move get_buffer down
This way the (slow) allocation of an image is done after various additional checks Fixes: Timeout Fixes: 379418967/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ESCAPE130_fuzzer-6507383574036480 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
89efc6c97c
commit
34c06f5284
1 changed files with 3 additions and 3 deletions
|
@ -212,9 +212,6 @@ static int escape130_decode_frame(AVCodecContext *avctx, AVFrame *pic,
|
|||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if ((ret = ff_get_buffer(avctx, pic, 0)) < 0)
|
||||
return ret;
|
||||
|
||||
if ((ret = init_get_bits8(&gb, avpkt->data, avpkt->size)) < 0)
|
||||
return ret;
|
||||
skip_bits_long(&gb, 16 * 8);
|
||||
|
@ -310,6 +307,9 @@ static int escape130_decode_frame(AVCodecContext *avctx, AVFrame *pic,
|
|||
skip--;
|
||||
}
|
||||
|
||||
if ((ret = ff_get_buffer(avctx, pic, 0)) < 0)
|
||||
return ret;
|
||||
|
||||
new_y = s->new_y;
|
||||
new_cb = s->new_u;
|
||||
new_cr = s->new_v;
|
||||
|
|
Loading…
Add table
Reference in a new issue