Commit ab28d57ba2 for ffmpeg
commit ab28d57ba2ec07b41b4a60ed8806b13a39ec86fe
Author: Michael Niedermayer <michael@niedermayer.cc>
Date: Tue Oct 20 03:04:00 2026 +0200
avcodec/dovi_rpuenc: do not divide by a zero frame rate denominator
Fixes: TPu5aVjgBh7t/testcase/crafted.hevc
Fixes: TPu5aVjgBh7t
Fixes: AISLE-2026-0150-00819
Fixes: division by zero
Division by zero Replicated through UnModified FFmpeg with UBSAN
Found-by: Joshua Rogers (AISLE)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
diff --git a/libavcodec/dovi_rpuenc.c b/libavcodec/dovi_rpuenc.c
index 177e99467e..bdda95f991 100644
--- a/libavcodec/dovi_rpuenc.c
+++ b/libavcodec/dovi_rpuenc.c
@@ -183,7 +183,7 @@ static av_cold int dovi_configure_ext(DOVIContext *s, enum AVCodecID codec_id,
}
pps = width * height;
- if (framerate.num) {
+ if (framerate.num > 0 && framerate.den > 0) {
pps = pps * framerate.num / framerate.den;
} else {
pps *= 25; /* sanity fallback */