Initialize FrameInfo rotation in GenericDecoderTest GenericDecoderTest color-space cases construct FrameInfo directly. The default constructor leaves rotation uninitialized, which can trip UBSan when GenericDecoder reads the enum. Initialize rotation to kVideoRotation_0 in both tests. Bug: webrtc:514423244 Change-Id: Ifebf07c0e4d0489ff87cb58d65ec6a7d7e7fd00e Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/473520 Reviewed-by: Erik Språng <sprang@webrtc.org> Commit-Queue: Boris Tsirkin <btsirkin@meta.com> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Cr-Commit-Position: refs/heads/main@{#47734}
diff --git a/modules/video_coding/generic_decoder_unittest.cc b/modules/video_coding/generic_decoder_unittest.cc index c0eaebd..2a36bbc 100644 --- a/modules/video_coding/generic_decoder_unittest.cc +++ b/modules/video_coding/generic_decoder_unittest.cc
@@ -29,6 +29,7 @@ #include "api/video/video_content_type.h" #include "api/video/video_frame.h" #include "api/video/video_frame_type.h" +#include "api/video/video_rotation.h" #include "api/video/video_timing.h" #include "api/video_codecs/video_decoder.h" #include "common_video/include/corruption_score_calculator.h" @@ -256,6 +257,7 @@ FrameInfo frame_info; frame_info.rtp_timestamp = kRtpTimestamp; frame_info.decode_start = Timestamp::Zero(); + frame_info.rotation = kVideoRotation_0; frame_info.content_type = VideoContentType::UNSPECIFIED; frame_info.frame_type = VideoFrameType::kVideoFrameKey; frame_info.color_space = kMappedColorSpace; @@ -324,6 +326,7 @@ FrameInfo frame_info; frame_info.rtp_timestamp = kRtpTimestamp; frame_info.decode_start = Timestamp::Zero(); + frame_info.rotation = kVideoRotation_0; frame_info.content_type = VideoContentType::UNSPECIFIED; frame_info.frame_type = VideoFrameType::kVideoFrameKey; frame_info.color_space = std::nullopt;