Skip to content

Commit

Permalink
vp9_ratectrl_rtc_test: initialize loopfilter_ctrl[]
Browse files Browse the repository at this point in the history
this was added in:
  7beafef vp9: Allow for disabling loopfilter per spatial layer
but the test doesn't zero initialize its svc_params_ member.

fixes the use of an uninitialized value, reported by valgrind and
integer sanitizer:
[ RUN      ] VP9/RcInterfaceSvcTest.Svc/0
==1064682== Conditional jump or move depends on uninitialised value(s)
==1064682==    at 0x1C5624: loopfilter_frame (vp9_encoder.c:3285)
==1064682==    by 0x1C9B54: encode_frame_to_data_rate (vp9_encoder.c:5595)
==1064682==    by 0x1CA2EE: SvcEncode (vp9_encoder.c:5789)
==1064682==    by 0x1CEA01: vp9_get_compressed_data (vp9_encoder.c:7891)
==1064682==    by 0x185F0E: encoder_encode (vp9_cx_iface.c:1437)
==1064682==    by 0x1503BB: vpx_codec_encode (vpx_encoder.c:208)

vp9/encoder/vp9_svc_layercontext.c:362:26: runtime error: implicit
conversion from type 'int' of value -1 (32-bit, signed) to type
'LOOPFILTER_CONTROL' changed the value to 4294967295 (32-bit, unsigned)
    #0 0x558925f45377 in vp9_restore_layer_context vp9/encoder/vp9_svc_layercontext.c:362:26
    webmproject#1 0x558925ef89fd in vp9_get_compressed_data vp9/encoder/vp9_encoder.c:7781:5
    #2 0x558925e3ef3e in encoder_encode vp9/vp9_cx_iface.c:1437:20

Bug: b/229626362
Change-Id: I33d244be7752c68b71efa9c62ca45d6b202ec761
  • Loading branch information
jzern committed Aug 23, 2022
1 parent f88dae6 commit a689fe6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions test/vp9_ratectrl_rtc_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ class RcInterfaceSvcTest : public ::libvpx_test::EncoderTest,
svc_params_.max_quantizers[i] = 56;
svc_params_.min_quantizers[i] = 2;
svc_params_.speed_per_layer[i] = 7;
svc_params_.loopfilter_ctrl[i] = LOOPFILTER_ALL;
}
cfg_.rc_end_usage = VPX_CBR;
cfg_.g_lag_in_frames = 0;
Expand Down

0 comments on commit a689fe6

Please sign in to comment.