[FFmpeg-cvslog] lavc/libkvazaar,libopenh264enc: drop redundant checks

Anton Khirnov git at videolan.org
Mon May 15 11:36:50 EEST 2023


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Thu May  4 11:16:27 2023 +0200| [2ad468ed1f7a7c67f1a2ab37c9e304b0011f0aae] | committer: Anton Khirnov

lavc/libkvazaar,libopenh264enc: drop redundant checks

The same check is present in encode_preinit_video().

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2ad468ed1f7a7c67f1a2ab37c9e304b0011f0aae
---

 libavcodec/libkvazaar.c     | 5 -----
 libavcodec/libopenh264enc.c | 5 -----
 2 files changed, 10 deletions(-)

diff --git a/libavcodec/libkvazaar.c b/libavcodec/libkvazaar.c
index 168486f4ec..b3faa0a64b 100644
--- a/libavcodec/libkvazaar.c
+++ b/libavcodec/libkvazaar.c
@@ -85,11 +85,6 @@ static av_cold int libkvazaar_init(AVCodecContext *avctx)
         cfg->framerate_num   = avctx->framerate.num;
         cfg->framerate_denom = avctx->framerate.den;
     } else {
-        if (avctx->ticks_per_frame > INT_MAX / avctx->time_base.num) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Could not set framerate for kvazaar: integer overflow\n");
-            return AVERROR(EINVAL);
-        }
         cfg->framerate_num   = avctx->time_base.den;
         cfg->framerate_denom = avctx->time_base.num * avctx->ticks_per_frame;
     }
diff --git a/libavcodec/libopenh264enc.c b/libavcodec/libopenh264enc.c
index 3c605fe8ea..15c3822824 100644
--- a/libavcodec/libopenh264enc.c
+++ b/libavcodec/libopenh264enc.c
@@ -139,11 +139,6 @@ static av_cold int svc_encode_init(AVCodecContext *avctx)
     if (avctx->framerate.num > 0 && avctx->framerate.den > 0) {
         param.fMaxFrameRate = av_q2d(avctx->framerate);
     } else {
-        if (avctx->ticks_per_frame > INT_MAX / avctx->time_base.num) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "Could not set framerate for libopenh264enc: integer overflow\n");
-            return AVERROR(EINVAL);
-        }
         param.fMaxFrameRate = 1.0 / av_q2d(avctx->time_base) / FFMAX(avctx->ticks_per_frame, 1);
     }
     param.iPicWidth                  = avctx->width;



More information about the ffmpeg-cvslog mailing list