[FFmpeg-cvslog] avcodec/mpegvideo_enc: Fix potential overflow in RD

2024-06-14 Thread Michael Niedermayer
ffmpeg | branch: release/4.3 | Michael Niedermayer  | 
Sun May 12 00:13:58 2024 +0200| [25826459d98d6d8baaad64884fe4bd37731ca90e] | 
committer: Michael Niedermayer

avcodec/mpegvideo_enc: Fix potential overflow in RD

Fixes: CID1500285 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer 
(cherry picked from commit b6b2b01025e016ce29e5add57305384a663edcfc)
Signed-off-by: Michael Niedermayer 

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

 libavcodec/mpegvideo_enc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index d084f1c8e6..623450e93d 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -1475,7 +1475,7 @@ static int estimate_best_b_count(MpegEncContext *s)
 goto fail;
 }
 
-rd += (out_size * lambda2) >> (FF_LAMBDA_SHIFT - 3);
+rd += (out_size * (uint64_t)lambda2) >> (FF_LAMBDA_SHIFT - 3);
 }
 
 /* get the delayed frames */
@@ -1484,7 +1484,7 @@ static int estimate_best_b_count(MpegEncContext *s)
 ret = out_size;
 goto fail;
 }
-rd += (out_size * lambda2) >> (FF_LAMBDA_SHIFT - 3);
+rd += (out_size * (uint64_t)lambda2) >> (FF_LAMBDA_SHIFT - 3);
 
 rd += c->error[0] + c->error[1] + c->error[2];
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] avcodec/mpegvideo_enc: Fix potential overflow in RD

2024-06-13 Thread Michael Niedermayer
ffmpeg | branch: release/5.1 | Michael Niedermayer  | 
Sun May 12 00:13:58 2024 +0200| [cb4e45231cdb3447c9690906b4edcd0b88f68a56] | 
committer: Michael Niedermayer

avcodec/mpegvideo_enc: Fix potential overflow in RD

Fixes: CID1500285 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer 
(cherry picked from commit b6b2b01025e016ce29e5add57305384a663edcfc)
Signed-off-by: Michael Niedermayer 

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

 libavcodec/mpegvideo_enc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index c528ac188e..d1c64a921d 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -1327,7 +1327,7 @@ static int estimate_best_b_count(MpegEncContext *s)
 goto fail;
 }
 
-rd += (out_size * lambda2) >> (FF_LAMBDA_SHIFT - 3);
+rd += (out_size * (uint64_t)lambda2) >> (FF_LAMBDA_SHIFT - 3);
 }
 
 /* get the delayed frames */
@@ -1336,7 +1336,7 @@ static int estimate_best_b_count(MpegEncContext *s)
 ret = out_size;
 goto fail;
 }
-rd += (out_size * lambda2) >> (FF_LAMBDA_SHIFT - 3);
+rd += (out_size * (uint64_t)lambda2) >> (FF_LAMBDA_SHIFT - 3);
 
 rd += c->error[0] + c->error[1] + c->error[2];
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] avcodec/mpegvideo_enc: Fix potential overflow in RD

2024-05-24 Thread Michael Niedermayer
ffmpeg | branch: release/6.1 | Michael Niedermayer  | 
Sun May 12 00:13:58 2024 +0200| [7cc79bfda97cba5699cb984e11e1fbd052936a89] | 
committer: Michael Niedermayer

avcodec/mpegvideo_enc: Fix potential overflow in RD

Fixes: CID1500285 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer 
(cherry picked from commit b6b2b01025e016ce29e5add57305384a663edcfc)
Signed-off-by: Michael Niedermayer 

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

 libavcodec/mpegvideo_enc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 9d048e3dec..c4c174a02e 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -1433,7 +1433,7 @@ static int estimate_best_b_count(MpegEncContext *s)
 goto fail;
 }
 
-rd += (out_size * lambda2) >> (FF_LAMBDA_SHIFT - 3);
+rd += (out_size * (uint64_t)lambda2) >> (FF_LAMBDA_SHIFT - 3);
 }
 
 /* get the delayed frames */
@@ -1442,7 +1442,7 @@ static int estimate_best_b_count(MpegEncContext *s)
 ret = out_size;
 goto fail;
 }
-rd += (out_size * lambda2) >> (FF_LAMBDA_SHIFT - 3);
+rd += (out_size * (uint64_t)lambda2) >> (FF_LAMBDA_SHIFT - 3);
 
 rd += c->error[0] + c->error[1] + c->error[2];
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] avcodec/mpegvideo_enc: Fix potential overflow in RD

2024-05-22 Thread Michael Niedermayer
ffmpeg | branch: release/7.0 | Michael Niedermayer  | 
Sun May 12 00:13:58 2024 +0200| [435b74c6a5d4e457d9526aa21e7a6e68926bf52c] | 
committer: Michael Niedermayer

avcodec/mpegvideo_enc: Fix potential overflow in RD

Fixes: CID1500285 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer 
(cherry picked from commit b6b2b01025e016ce29e5add57305384a663edcfc)
Signed-off-by: Michael Niedermayer 

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

 libavcodec/mpegvideo_enc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 9d048e3dec..c4c174a02e 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -1433,7 +1433,7 @@ static int estimate_best_b_count(MpegEncContext *s)
 goto fail;
 }
 
-rd += (out_size * lambda2) >> (FF_LAMBDA_SHIFT - 3);
+rd += (out_size * (uint64_t)lambda2) >> (FF_LAMBDA_SHIFT - 3);
 }
 
 /* get the delayed frames */
@@ -1442,7 +1442,7 @@ static int estimate_best_b_count(MpegEncContext *s)
 ret = out_size;
 goto fail;
 }
-rd += (out_size * lambda2) >> (FF_LAMBDA_SHIFT - 3);
+rd += (out_size * (uint64_t)lambda2) >> (FF_LAMBDA_SHIFT - 3);
 
 rd += c->error[0] + c->error[1] + c->error[2];
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] avcodec/mpegvideo_enc: Fix potential overflow in RD

2024-05-19 Thread Michael Niedermayer
ffmpeg | branch: master | Michael Niedermayer  | Sun 
May 12 00:13:58 2024 +0200| [b6b2b01025e016ce29e5add57305384a663edcfc] | 
committer: Michael Niedermayer

avcodec/mpegvideo_enc: Fix potential overflow in RD

Fixes: CID1500285 Unintentional integer overflow

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer 

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

 libavcodec/mpegvideo_enc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index b601a1a9e4..73a9082265 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -1433,7 +1433,7 @@ static int estimate_best_b_count(MpegEncContext *s)
 goto fail;
 }
 
-rd += (out_size * lambda2) >> (FF_LAMBDA_SHIFT - 3);
+rd += (out_size * (uint64_t)lambda2) >> (FF_LAMBDA_SHIFT - 3);
 }
 
 /* get the delayed frames */
@@ -1442,7 +1442,7 @@ static int estimate_best_b_count(MpegEncContext *s)
 ret = out_size;
 goto fail;
 }
-rd += (out_size * lambda2) >> (FF_LAMBDA_SHIFT - 3);
+rd += (out_size * (uint64_t)lambda2) >> (FF_LAMBDA_SHIFT - 3);
 
 rd += c->error[0] + c->error[1] + c->error[2];
 

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".