avcodec/eatgq: Check bytestream2_get_buffer() for failure

Fixes: Use of uninitialized memory
Fixes: 71546/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EATGQ_fuzzer-5607656650244096

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4949e34d96)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
release/7.1
Michael Niedermayer 4 months ago
parent 851bc9927d
commit 048a545e31
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
  1. 3
      libavcodec/eatgq.c

@ -178,7 +178,8 @@ static int tgq_decode_mb(TgqContext *s, GetByteContext *gbyte,
dc[4] = bytestream2_get_byte(gbyte);
dc[5] = bytestream2_get_byte(gbyte);
} else if (mode == 6) {
bytestream2_get_buffer(gbyte, dc, 6);
if (bytestream2_get_buffer(gbyte, dc, 6) != 6)
return AVERROR_INVALIDDATA;
} else if (mode == 12) {
for (i = 0; i < 6; i++) {
dc[i] = bytestream2_get_byte(gbyte);

Loading…
Cancel
Save