avcodec/dovi_rpuenc: avoid division by zero

Fixes: https://trac.ffmpeg.org/ticket/10985
This commit is contained in:
Niklas Haas 2024-04-30 21:32:04 +02:00
parent b7debef3cc
commit 1d89de03d6

View File

@ -245,7 +245,7 @@ static inline void put_se_coef(PutBitContext *pb, const AVDOVIRpuDataHeader *hdr
static int av_q2den(AVRational q, int den)
{
if (q.den == den)
if (!q.den || q.den == den)
return q.num;
q = av_mul_q(q, av_make_q(den, 1));
return (q.num + (q.den >> 1)) / q.den;