[FFmpeg-devel] [PATCH] avformat/mxfenc: calculate and store DAR from user SAR
Paul B Mahol
onemda at gmail.com
Sun Dec 9 14:53:42 EET 2018
On 12/9/18, Tomas Härdin <tjoppen at acc.umu.se> wrote:
> fre 2018-12-07 klockan 21:30 +0100 skrev Paul B Mahol:
>> Fixes #5155
>>
>> > Signed-off-by: Paul B Mahol <onemda at gmail.com>
>> ---
>> libavformat/mxfenc.c | 8 ++++++++
>> 1 file changed, 8 insertions(+)
>>
>> diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
>> index 3549b4137d..8f762c7eaf 100644
>> --- a/libavformat/mxfenc.c
>> +++ b/libavformat/mxfenc.c
>> @@ -2726,6 +2726,14 @@ static int mxf_write_packet(AVFormatContext *s,
>> AVPacket *pkt)
>> }
>> }
>>
>> + if (st->codecpar->sample_aspect_ratio.num &&
>> st->codecpar->sample_aspect_ratio.den) {
>> + av_reduce(&sc->aspect_ratio.num, &sc->aspect_ratio.den,
>> + st->codecpar->sample_aspect_ratio.num *
>> st->codecpar->width,
>> + st->codecpar->sample_aspect_ratio.den *
>> st->codecpar->height, INT_MAX);
>
> Can these multiplications ever overflow? av_reduce_q might be a better
> choice.
There is no av_reduce_q.
More information about the ffmpeg-devel
mailing list