Repository: Rust-SDL2/rust-sdl2 (language: rust)

Issue:
Canvas::read_pixels causes segmentation fault 
`Canvas::read_pixels` causes a segmentation fault when using `PixelFormatEnum::YV12` or `PixelFormatEnum::IYUV`

simple test case:
```
extern crate sdl2;
use sdl2::pixels::PixelFormatEnum;

fn main() {
    let sdl_context = sdl2::init().unwrap();
    let video_subsystem = sdl_context.video().unwrap();

    let window = video_subsystem.window("yuv test", 1280, 720)
        .position_centered()
        .hidden()
        .build()
        .unwrap();
    let canvas = window.into_canvas().build().unwrap();

    canvas.read_pixels(None, PixelFormatEnum::YV12).unwrap(); // segmentation fault
}
```


Discussion / hints:

Fix patch:
diff --git a/src/sdl2/pixels.rs b/src/sdl2/pixels.rs
index 9e55f874c4..29abecae32 100644
--- a/src/sdl2/pixels.rs
+++ b/src/sdl2/pixels.rs
@@ -393,7 +393,7 @@ impl PixelFormatEnum {
             | PixelFormatEnum::BGRA8888
             | PixelFormatEnum::ARGB2101010 => 4,
             // YUV formats
-            PixelFormatEnum::YV12 | PixelFormatEnum::IYUV => 2,
+            PixelFormatEnum::YV12 | PixelFormatEnum::IYUV => 1,
             PixelFormatEnum::YUY2 | PixelFormatEnum::UYVY | PixelFormatEnum::YVYU => 2,
             // Unsupported formats
             PixelFormatEnum::Index8 => 1,


Test patch: