aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-10-23 17:19:20 +0200
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-11-07 00:51:49 +0100
commit54b8fbbc5dc9b74e0a96d7730bfacc8bc1b59e85 (patch)
treedde329e726b5f546bb35724cc001226e4560d3ce
parenteb205eda3fec9959037c419548b1ebfaa6c59c33 (diff)
downloadffmpeg-54b8fbbc5dc9b74e0a96d7730bfacc8bc1b59e85.tar.gz
voc_packet: validate sample_rate
A negative sample rate doesn't make sense and triggers assertions in av_rescale_rnd. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
-rw-r--r--libavformat/voc_packet.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/voc_packet.c b/libavformat/voc_packet.c
index 5833a79b56..0d564367db 100644
--- a/libavformat/voc_packet.c
+++ b/libavformat/voc_packet.c
@@ -106,6 +106,11 @@ ff_voc_get_packet(AVFormatContext *s, AVPacket *pkt, AVStream *st, int max_size)
}
}
+ if (par->sample_rate <= 0) {
+ av_log(s, AV_LOG_ERROR, "Invalid sample rate %d\n", par->sample_rate);
+ return AVERROR_INVALIDDATA;
+ }
+
if (tmp_codec >= 0) {
tmp_codec = ff_codec_get_id(ff_voc_codec_tags, tmp_codec);
if (par->codec_id == AV_CODEC_ID_NONE)