mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-12 18:25:03 +00:00
lavf: fix signed overflow in avformat_find_stream_info()
On the first iteration through this code, last_dts is always
INT64_MIN (AV_NOPTS_VALUE) and the subtraction overflows in
an invalid manner. Although the result is only used if the
input values are valid, performing the subtraction is still
not allowed in a strict environment.
Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit a31e9f68a4
)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
f7be632cbd
commit
edc942202b
@ -2396,9 +2396,9 @@ int av_find_stream_info(AVFormatContext *ic)
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
int64_t last = st->info->last_dts;
|
int64_t last = st->info->last_dts;
|
||||||
int64_t duration= pkt->dts - last;
|
|
||||||
|
|
||||||
if(pkt->dts != AV_NOPTS_VALUE && last != AV_NOPTS_VALUE && duration>0){
|
if(pkt->dts != AV_NOPTS_VALUE && last != AV_NOPTS_VALUE && pkt->dts > last){
|
||||||
|
int64_t duration= pkt->dts - last;
|
||||||
double dur= duration * av_q2d(st->time_base);
|
double dur= duration * av_q2d(st->time_base);
|
||||||
|
|
||||||
// if(st->codec->codec_type == AVMEDIA_TYPE_VIDEO)
|
// if(st->codec->codec_type == AVMEDIA_TYPE_VIDEO)
|
||||||
|
Loading…
Reference in New Issue
Block a user