Mercurial > repos > blastem
diff vdp.c @ 2494:b62580dc6f30
Fix kmod buffer storage bug
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sun, 28 Apr 2024 23:18:53 -0700 |
parents | cf3e8a19aa25 |
children | fa49e06d8c92 |
line wrap: on
line diff
--- 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;