avcodec/dovi_rpuenc: avoid division by zero

Fixes: https://trac.ffmpeg.org/ticket/10985
release/7.1
Niklas Haas 7 months ago
parent b7debef3cc
commit 1d89de03d6
  1. 2
      libavcodec/dovi_rpuenc.c

@ -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;

Loading…
Cancel
Save