X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fmpsubdec.c;h=ee53be17d652b24904a313b90b4a1cf2232df17d;hb=bc70684e74a185d7b80c8b80bdedda659cb581b8;hp=e7b83a1d85f1f5531392646fcc5fdd164e202169;hpb=a5ed8aeea4f4199e89520c3fdbd9d07ae7fc3c3f;p=ffmpeg diff --git a/libavformat/mpsubdec.c b/libavformat/mpsubdec.c index e7b83a1d85f..ee53be17d65 100644 --- a/libavformat/mpsubdec.c +++ b/libavformat/mpsubdec.c @@ -72,8 +72,8 @@ static int parse_line(const char *line, int64_t *value, int64_t *value2) fracval *= 10; for (;p2 - p1 > 7 + 1; p1++) fracval /= 10; - if (intval > 0) intval += fracval; - else intval -= fracval; + if (intval > 0) intval = av_sat_add64(intval, fracval); + else intval = av_sat_sub64(intval, fracval); line += p2; } else line += p1; @@ -147,8 +147,8 @@ static int mpsub_read_header(AVFormatContext *s) if (common_factor > 1) { common_factor = av_gcd(pts_info.num, common_factor); for (i = 0; i < mpsub->q.nb_subs; i++) { - mpsub->q.subs[i].pts /= common_factor; - mpsub->q.subs[i].duration /= common_factor; + mpsub->q.subs[i]->pts /= common_factor; + mpsub->q.subs[i]->duration /= common_factor; } pts_info.num /= common_factor; } @@ -193,7 +193,7 @@ static int mpsub_read_close(AVFormatContext *s) return 0; } -AVInputFormat ff_mpsub_demuxer = { +const AVInputFormat ff_mpsub_demuxer = { .name = "mpsub", .long_name = NULL_IF_CONFIG_SMALL("MPlayer subtitles"), .priv_data_size = sizeof(MPSubContext),