From ca0baf8340f8fec6c568a291ddc5b61e7e511bca Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Mon, 2 Sep 2024 10:52:20 +0200 Subject: [PATCH] vdisp/sdl2: set correct data_len if pitch!=linelen fixes: ``` uv -t testcard:codec=RGB:size=1921x1080 -d sdl ``` Doesn't crash but errors are printed on console and data at the end (perhaps something like a line) is not written. --- src/video_display/sdl2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/video_display/sdl2.c b/src/video_display/sdl2.c index 61353b69f..8d2eae28e 100644 --- a/src/video_display/sdl2.c +++ b/src/video_display/sdl2.c @@ -468,6 +468,7 @@ static bool recreate_textures(struct state_sdl2 *s, struct video_desc desc) { struct video_frame *f = vf_alloc_desc(desc); f->callbacks.dispose_udata = (void *) texture; SDL_CHECK(SDL_LockTexture(texture, NULL, (void **) &f->tiles[0].data, &s->texture_pitch)); + f->tiles[0].data_len = desc.height * s->texture_pitch; f->callbacks.data_deleter = vf_sdl_texture_data_deleter; simple_linked_list_append(s->free_frame_queue, f); }