Commit 4c9f35bb authored by Michael Niedermayer's avatar Michael Niedermayer

mvdec: use avpriv_set_pts_info() instead of directly setting tb.

Fixes division by 0

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 1bb05797
...@@ -165,7 +165,8 @@ static int parse_video_var(AVFormatContext *avctx, AVStream *st, const char *nam ...@@ -165,7 +165,8 @@ static int parse_video_var(AVFormatContext *avctx, AVStream *st, const char *nam
} }
av_free(str); av_free(str);
} else if (!strcmp(name, "FPS")) { } else if (!strcmp(name, "FPS")) {
st->time_base = av_inv_q(var_read_float(pb, size)); AVRational tb = av_inv_q(var_read_float(pb, size));
avpriv_set_pts_info(st, 64, tb.num, tb.den);
} else if (!strcmp(name, "HEIGHT")) { } else if (!strcmp(name, "HEIGHT")) {
st->codec->height = var_read_int(pb, size); st->codec->height = var_read_int(pb, size);
} else if (!strcmp(name, "PIXEL_ASPECT")) { } else if (!strcmp(name, "PIXEL_ASPECT")) {
...@@ -250,7 +251,7 @@ static int mv_read_header(AVFormatContext *avctx) ...@@ -250,7 +251,7 @@ static int mv_read_header(AVFormatContext *avctx)
if (!vst) if (!vst)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
vst->codec->codec_type = AVMEDIA_TYPE_VIDEO; vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
vst->time_base = (AVRational){1, 15}; avpriv_set_pts_info(vst, 64, 1, 15);
vst->nb_frames = avio_rb32(pb); vst->nb_frames = avio_rb32(pb);
v = avio_rb32(pb); v = avio_rb32(pb);
switch (v) { switch (v) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment