Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavformat/rsd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/rsd.c b/libavformat/rsd.c
index ee6fdfbeb1..5a56e72bb3 100644
--- a/libavformat/rsd.c
+++ b/libavformat/rsd.c
@@ -84,8 +84,10 @@ static int rsd_read_header(AVFormatContext *s)
}
par->channels = avio_rl32(pb);
- if (!par->channels)
+ if (par->channels <= 0 || par->channels > INT_MAX / 36) {
+ av_log(s, AV_LOG_ERROR, "Invalid number of channels: %d\n", par->channels);
return AVERROR_INVALIDDATA;
+ }
avio_skip(pb, 4); // Bit depth
par->sample_rate = avio_rl32(pb);