avformat/rka: bps < 8 is invalid

Fixes: division by zero
Fixes: 57828/clusterfuzz-testcase-minimized-ffmpeg_dem_RKA_fuzzer-6571818338353152

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:
Michael Niedermayer 2023-04-09 16:01:35 +02:00
parent fd5aa93a37
commit 167b4f56f1
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64

View File

@ -72,7 +72,7 @@ static int rka_read_header(AVFormatContext *s)
if (channels == 0)
return AVERROR_INVALIDDATA;
bps = par->extradata[13];
if (bps == 0)
if (bps < 8)
return AVERROR_INVALIDDATA;
size_offset = avio_rl32(s->pb);
framepos = avio_tell(s->pb);