# HG changeset patch # User Michael Pavone # Date 1714371533 25200 # Node ID b62580dc6f30e025319bd29de4409570d21b6d2d # Parent b62336ceb6264a430f2f73de5a43afcc30684c5b Fix kmod buffer storage bug diff -r b62336ceb626 -r b62580dc6f30 vdp.c --- a/vdp.c Wed Apr 17 22:18:45 2024 -0700 +++ b/vdp.c Sun Apr 28 23:18:53 2024 -0700 @@ -4692,7 +4692,7 @@ if (c) { context->kmod_buffer_length++; if ((context->kmod_buffer_length + 1) > context->kmod_buffer_storage) { - context->kmod_buffer_storage = context->kmod_buffer_length ? 128 : context->kmod_buffer_length * 2; + context->kmod_buffer_storage = context->kmod_buffer_storage ? context->kmod_buffer_storage * 2 : 128; context->kmod_msg_buffer = realloc(context->kmod_msg_buffer, context->kmod_buffer_storage); } context->kmod_msg_buffer[context->kmod_buffer_length - 1] = c;