r3d: check that sampling rate is non negative.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/9/head
Michael Niedermayer 12 years ago
parent df92ac1852
commit 99b1b2b1c6
  1. 4
      libavformat/r3d.c

@ -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);

Loading…
Cancel
Save