Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Unified Diff: webrtc/modules/video_coding/media_opt_util.cc

Issue 1642903002: Prevent division-by-zero in VCMFecMethod. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/video_coding/media_opt_util.cc
diff --git a/webrtc/modules/video_coding/media_opt_util.cc b/webrtc/modules/video_coding/media_opt_util.cc
index d57e9c8dd28120e1d1765a31163440efa3d6bf93..69cf757f2b45adeb8804e2c9b726ed0f0e61d0c2 100644
--- a/webrtc/modules/video_coding/media_opt_util.cc
+++ b/webrtc/modules/video_coding/media_opt_util.cc
@@ -434,6 +434,8 @@ int VCMFecMethod::BitsPerFrame(const VCMProtectionParameters* parameters) {
// TODO(mikhal): Update factor following testing.
float adjustmentFactor = 1;
+ if (frameRate < 1.0f)
+ frameRate = 1.0f;
// Average bits per frame (units of kbits)
return static_cast<int>(adjustmentFactor * bitRate / frameRate);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698