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

Make sure neither data_size nor sample_count is negative

This commit is contained in:
Tomas Härdin 2011-05-17 19:52:36 +02:00 committed by Michael Niedermayer
parent cc1ca9e534
commit 3d922c8462

View File

@ -238,6 +238,12 @@ static int wav_read_header(AVFormatContext *s,
avio_rl64(pb); /* RIFF size */ avio_rl64(pb); /* RIFF size */
data_size = avio_rl64(pb); data_size = avio_rl64(pb);
sample_count = avio_rl64(pb); sample_count = avio_rl64(pb);
if (data_size < 0 || sample_count < 0) {
av_log(s, AV_LOG_ERROR, "negative data_size and/or sample_count in "
"ds64: data_size = %li, sample_count = %li\n",
data_size, sample_count);
return AVERROR_INVALIDDATA;
}
avio_skip(pb, size - 16); /* skip rest of ds64 chunk */ avio_skip(pb, size - 16); /* skip rest of ds64 chunk */
} }