diff --git a/media/base/decoder.cc b/media/base/decoder.cc index bf323da4a171e..52981222c503d 100644 --- a/media/base/decoder.cc +++ b/media/base/decoder.cc @@ -83,6 +83,8 @@ const char* GetDecoderName(AudioDecoderType type) { return "MediaFoundationAudioDecoder"; case AudioDecoderType::kSymphonia: return "SymphoniaAudioDecoder"; + default: + return "Unknown Audio Decoder"; } } diff --git a/media/cast/openscreen/remoting_proto_utils.cc b/media/cast/openscreen/remoting_proto_utils.cc index 43bb7d5e57ef2..3b4ad91779728 100644 --- a/media/cast/openscreen/remoting_proto_utils.cc +++ b/media/cast/openscreen/remoting_proto_utils.cc @@ -331,8 +331,13 @@ void ConvertProtoToPipelineStatistics( // that sender provided the values. if (stats_message.has_audio_decoder_info()) { auto audio_info = stats_message.audio_decoder_info(); - stats->audio_pipeline_info.decoder_type = - static_cast(audio_info.decoder_type()); + const auto audio_decoder_type_value = audio_info.decoder_type(); + if (audio_decoder_type_value >= 0 && + audio_decoder_type_value <= + static_cast(media::AudioDecoderType::kMaxValue)) { + stats->audio_pipeline_info.decoder_type = + static_cast(audio_decoder_type_value); + } stats->audio_pipeline_info.is_platform_decoder = audio_info.is_platform_decoder(); stats->audio_pipeline_info.has_decrypting_demuxer_stream = false;