Skip to content

Commit 1c56e65

Browse files
committed
vdisp/sdl2: fixed I420 (IYUV)
The pitch for planar pixel formats is the pitch of the first plane, most likely =width. This yield wrong data_len for I420 if just multiplied by the height. this fixes the change made by 107e3e3 (2024-09-02)
1 parent a15c14f commit 1c56e65

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/video_display/sdl2.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,9 @@ static bool recreate_textures(struct state_sdl2 *s, struct video_desc desc) {
488488
(void **) &f->tiles[0].data,
489489
&s->texture_pitch),
490490
return false);
491-
f->tiles[0].data_len = desc.height * s->texture_pitch;
491+
if (!codec_is_planar(desc.color_spec)) {
492+
f->tiles[0].data_len = desc.height * s->texture_pitch;
493+
}
492494
f->callbacks.data_deleter = vf_sdl_texture_data_deleter;
493495
simple_linked_list_append(s->free_frame_queue, f);
494496
}

0 commit comments

Comments
 (0)