aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-10-23 15:54:01 +0200
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-11-07 00:51:49 +0100
commit872fcfcc0f01230ef761e286b0c6a18817e0a162 (patch)
treede5983ea605b7c9c46a7ac307766bee264a3107a
parent2eb05eaa682ec49eade91e358ace4e1415695686 (diff)
downloadffmpeg-872fcfcc0f01230ef761e286b0c6a18817e0a162.tar.gz
bfi: validate sample_rate
A negative sample rate doesn't make sense and triggers assertions in av_rescale_rnd. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
-rw-r--r--libavformat/bfi.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/bfi.c b/libavformat/bfi.c
index 568363dd91..ef4c17dddb 100644
--- a/libavformat/bfi.c
+++ b/libavformat/bfi.c
@@ -88,6 +88,10 @@ static int bfi_read_header(AVFormatContext * s)
vstream->codecpar->extradata_size);
astream->codecpar->sample_rate = avio_rl32(pb);
+ if (astream->codecpar->sample_rate <= 0) {
+ av_log(s, AV_LOG_ERROR, "Invalid sample rate %d\n", astream->codecpar->sample_rate);
+ return AVERROR_INVALIDDATA;
+ }
/* Set up the video codec... */
avpriv_set_pts_info(vstream, 32, 1, fps);