mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-28 12:32:17 +02:00
avformat/matroskadec: Fix float-cast-overflow undefined behavior in matroska_parse_tracks()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
0afa171f25
commit
e07649e618
@ -2096,8 +2096,16 @@ static int matroska_parse_tracks(AVFormatContext *s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (track->type == MATROSKA_TRACK_TYPE_VIDEO) {
|
if (track->type == MATROSKA_TRACK_TYPE_VIDEO) {
|
||||||
if (!track->default_duration && track->video.frame_rate > 0)
|
if (!track->default_duration && track->video.frame_rate > 0) {
|
||||||
track->default_duration = 1000000000 / track->video.frame_rate;
|
double default_duration = 1000000000 / track->video.frame_rate;
|
||||||
|
if (default_duration > UINT64_MAX || default_duration < 0) {
|
||||||
|
av_log(matroska->ctx, AV_LOG_WARNING,
|
||||||
|
"Invalid frame rate %e. Cannot calculate default duration.\n",
|
||||||
|
track->video.frame_rate);
|
||||||
|
} else {
|
||||||
|
track->default_duration = default_duration;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (track->video.display_width == -1)
|
if (track->video.display_width == -1)
|
||||||
track->video.display_width = track->video.pixel_width;
|
track->video.display_width = track->video.pixel_width;
|
||||||
if (track->video.display_height == -1)
|
if (track->video.display_height == -1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user