1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

avcodec/wmaprodec: Check that the EOF frame was allocated before decoding into it

Fixes: NULL pointer dereference
Fixes: 38125/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_XMA1_fuzzer-5151909422432256

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2021-09-17 00:21:25 +02:00
parent ccfdef79b1
commit 48bbeac259

View File

@ -1855,7 +1855,7 @@ static int xma_decode_packet(AVCodecContext *avctx, void *data,
eof = 1;
for (i = 0; i < s->num_streams; i++) {
if (!s->xma[i].eof_done) {
if (!s->xma[i].eof_done && s->frames[i]->data[0]) {
ret = decode_packet(avctx, &s->xma[i], s->frames[i],
&got_stream_frame_ptr, avpkt);
}