aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorTomas Härdin <tomas.hardin@codemill.se>2011-12-20 11:32:23 +0100
committerTomas Härdin <tomas.hardin@codemill.se>2011-12-20 11:34:48 +0100
commit5b718009b2c54a6ade9241fe5ae175e6f069791b (patch)
tree35aec1c92b84d1caa33785522e78fd97d1ef6a5a /libavformat
parent1888bd1b6d2bedc7bbded91d3a8d236236b5aa3c (diff)
downloadffmpeg-5b718009b2c54a6ade9241fe5ae175e6f069791b.tar.gz
mxfdec: Sanity-check SampleRate
This avoids a SIGFPE if SampleRate is missing or set to naughty values.
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/mxfdec.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 75d4b51a3f..b6a63c90a2 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -1370,6 +1370,7 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
st->codec->codec_id = container_ul->id;
st->codec->channels = descriptor->channels;
st->codec->bits_per_coded_sample = descriptor->bits_per_sample;
+ if (descriptor->sample_rate.den > 0)
st->codec->sample_rate = descriptor->sample_rate.num / descriptor->sample_rate.den;
/* TODO: implement CODEC_ID_RAWAUDIO */
if (st->codec->codec_id == CODEC_ID_PCM_S16LE) {