aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-01-22 22:40:38 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-01-22 22:41:09 +0100
commit4c9f35bb7c94d20455d3fca3a184b892f1a0aa4e (patch)
tree8c0c5c5122efa5e07a0b5a51a17abd1448f87369 /libavformat
parent1bb05797ec27a0a2b921c18466f898b23c4a9740 (diff)
downloadffmpeg-4c9f35bb7c94d20455d3fca3a184b892f1a0aa4e.tar.gz
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: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/mvdec.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/mvdec.c b/libavformat/mvdec.c
index bb1c5d0dd8..80fc466889 100644
--- a/libavformat/mvdec.c
+++ b/libavformat/mvdec.c
@@ -165,7 +165,8 @@ static int parse_video_var(AVFormatContext *avctx, AVStream *st, const char *nam
}
av_free(str);
} 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")) {
st->codec->height = var_read_int(pb, size);
} else if (!strcmp(name, "PIXEL_ASPECT")) {
@@ -250,7 +251,7 @@ static int mv_read_header(AVFormatContext *avctx)
if (!vst)
return AVERROR(ENOMEM);
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);
v = avio_rb32(pb);
switch (v) {