nutdec: check for negative frame rate in decode_info_header

A negative frame rate triggers an av_assert2 in av_rescale_rnd.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
pull/135/head
Andreas Cadhalpun 10 years ago committed by Michael Niedermayer
parent 5bebd13d2d
commit 6621105877
  1. 3
      libavformat/nutdec.c

@ -553,7 +553,8 @@ static int decode_info_header(NUTContext *nut)
if (stream_id_plus1 && !strcmp(name, "r_frame_rate")) { if (stream_id_plus1 && !strcmp(name, "r_frame_rate")) {
sscanf(str_value, "%d/%d", &st->r_frame_rate.num, &st->r_frame_rate.den); sscanf(str_value, "%d/%d", &st->r_frame_rate.num, &st->r_frame_rate.den);
if (st->r_frame_rate.num >= 1000LL*st->r_frame_rate.den) if (st->r_frame_rate.num >= 1000LL*st->r_frame_rate.den ||
st->r_frame_rate.num < 0 || st->r_frame_rate.num < 0)
st->r_frame_rate.num = st->r_frame_rate.den = 0; st->r_frame_rate.num = st->r_frame_rate.den = 0;
continue; continue;
} }

Loading…
Cancel
Save