avformat/segafilm: dont read uninitialized value

scratch[20] doesnt exist in version 0

Fixes: use of uninitialized memory
Fixes: 471664627/clusterfuzz-testcase-minimized-ffmpeg_dem_SEGAFILM_fuzzer-4738726971637760

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
This commit is contained in:
Michael Niedermayer
2026-02-08 00:28:04 +01:00
parent 8eecba02c7
commit b2f1657087

View File

@@ -163,7 +163,7 @@ static int film_read_header(AVFormatContext *s)
st->codecpar->height = AV_RB32(&scratch[12]); st->codecpar->height = AV_RB32(&scratch[12]);
if (film->video_type == AV_CODEC_ID_RAWVIDEO) { if (film->video_type == AV_CODEC_ID_RAWVIDEO) {
if (scratch[20] == 24) { if (film->version == 0 || scratch[20] == 24) {
st->codecpar->format = AV_PIX_FMT_RGB24; st->codecpar->format = AV_PIX_FMT_RGB24;
} else { } else {
av_log(s, AV_LOG_ERROR, "raw video is using unhandled %dbpp\n", scratch[20]); av_log(s, AV_LOG_ERROR, "raw video is using unhandled %dbpp\n", scratch[20]);