History

rtpenc: Cast a rescaling parameter to int64_t

This avoids overflow if frame_size is over 2147, since both frame_size and AV_TIME_BASE are plain integers.

Martin Storsjö committed 14 years ago

Commit 2d31d891 parent 2574f081 file · +1 −1Browse files

Unified · Split

libavformat/rtpenc.c+1−1
@@ -121,7 +121,7 @@ static int rtp_write_header(AVFormatContext *s1) · 120 unmodified lines
121121 if (st->codec->frame_size == 0) {
122122 av_log(s1, AV_LOG_ERROR, "Cannot respect max delay: frame size = 0\n");
123123 } else {
124− s->max_frames_per_packet = av_rescale_rnd(s1->max_delay, st->codec->sample_rate, AV_TIME_BASE * st->codec->frame_size, AV_ROUND_DOWN);
124+ s->max_frames_per_packet = av_rescale_rnd(s1->max_delay, st->codec->sample_rate, AV_TIME_BASE * (int64_t)st->codec->frame_size, AV_ROUND_DOWN);
125125 }
126126 }
127127 if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t