[FFmpeg-cvslog] avcodec/dovi_rpuenc: avoid division by zero
Niklas Haas
git at videolan.org
Tue Apr 30 22:38:04 EEST 2024
ffmpeg | branch: master | Niklas Haas <git at haasn.dev> | Tue Apr 30 21:32:04 2024 +0200| [1d89de03d6a9273b5d552a02d50f8f23b6c84f9d] | committer: Niklas Haas
avcodec/dovi_rpuenc: avoid division by zero
Fixes: https://trac.ffmpeg.org/ticket/10985
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1d89de03d6a9273b5d552a02d50f8f23b6c84f9d
---
libavcodec/dovi_rpuenc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/dovi_rpuenc.c b/libavcodec/dovi_rpuenc.c
index 8b99bf12d9..3feaa04b9e 100644
--- a/libavcodec/dovi_rpuenc.c
+++ b/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;
More information about the ffmpeg-cvslog
mailing list