[FFmpeg-cvslog] mxfdec: Sanity-check SampleRate
Tomas Härdin
git at videolan.org
Wed Dec 21 16:03:02 CET 2011
ffmpeg | branch: master | Tomas Härdin <tomas.hardin at codemill.se> | Tue Dec 20 11:32:23 2011 +0100| [5b718009b2c54a6ade9241fe5ae175e6f069791b] | committer: Tomas Härdin
mxfdec: Sanity-check SampleRate
This avoids a SIGFPE if SampleRate is missing or set to naughty values.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5b718009b2c54a6ade9241fe5ae175e6f069791b
---
libavformat/mxfdec.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 75d4b51..b6a63c9 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) {
More information about the ffmpeg-cvslog
mailing list