r3d: check that sampling rate is non negative.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-01-29 17:13:45 +01:00
parent df92ac1852
commit 99b1b2b1c6
1 changed files with 4 additions and 0 deletions

View File

@ -285,6 +285,10 @@ static int r3d_read_reda(AVFormatContext *s, AVPacket *pkt, Atom *atom)
dts = avio_rb32(s->pb);
st->codec->sample_rate = avio_rb32(s->pb);
if (st->codec->sample_rate < 0) {
av_log(s, AV_LOG_ERROR, "negative sample rate\n");
return AVERROR_INVALIDDATA;
}
samples = avio_rb32(s->pb);