Fix potential division by zero in VP9 VideoCodecTest.
When GetSvcConfig returned fewer spatial layers than the number statically configured from the test, we would crash on a SIGFPE. This is not a problem in the production code, since there we reset the encoder with the correct number of spatial layers whenever the resolution changes. Bug: None Change-Id: I339e4a3c0fa993c7c649533c0eae71e1314194e7 Reviewed-on: https://webrtc-review.googlesource.com/85374 Reviewed-by: Michael Horowitz <mhoro@webrtc.org> Reviewed-by: Sergey Silkin <ssilkin@webrtc.org> Commit-Queue: Rasmus Brandt <brandtr@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23741}
This commit is contained in:
committed by
Commit Bot
parent
63c82a78d3
commit
58cd385e58
@ -76,6 +76,8 @@ void ConfigureSvc(VideoCodec* codec_settings) {
|
||||
codec_settings->VP9()->numberOfSpatialLayers,
|
||||
codec_settings->VP9()->numberOfTemporalLayers,
|
||||
/* is_screen_sharing = */ false);
|
||||
ASSERT_EQ(codec_settings->VP9()->numberOfSpatialLayers, layers.size())
|
||||
<< "GetSvcConfig returned fewer spatial layers than configured.";
|
||||
|
||||
for (size_t i = 0; i < layers.size(); ++i) {
|
||||
codec_settings->spatialLayers[i] = layers[i];
|
||||
|
||||
Reference in New Issue
Block a user