Merge pull request #514 from Cobrand/master

Fixed renderer.info() crash on some machines
This commit is contained in:
Tony Aldridge
2016-06-06 09:30:30 +01:00
+1 -1
View File
@@ -110,7 +110,7 @@ impl RendererInfo {
let texture_formats: Vec<pixels::PixelFormatEnum> =
info.texture_formats[0..(info.num_texture_formats as usize)]
.iter().map(|&format| {
FromPrimitive::from_i64(format as i64).unwrap()
PixelFormatEnum::from_i64(format as i64).unwrap_or(PixelFormatEnum::Unknown)
}).collect();
// The driver name is always a static string, compiled into SDL2.