From ca5548dbdec6856e5ca0358f2ef1d636631bfbb1 Mon Sep 17 00:00:00 2001 From: David T Lewis Date: Mon, 18 Mar 2024 15:57:20 -0400 Subject: [PATCH] BMPReadWriterPlugin generated source per VMMaker-dtl.442. Fix bug in BMPReadWriterPlugin that caused unnecessary primitive failures. Fix provided by Juan Vuletich, see https://lists.cuis.st/mailman/archives/cuis-dev/2024-March/008599.html --- .../BMPReadWriterPlugin/BMPReadWriterPlugin.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plugins/BMPReadWriterPlugin/BMPReadWriterPlugin.c b/src/plugins/BMPReadWriterPlugin/BMPReadWriterPlugin.c index a8b56f0053..2b81261085 100644 --- a/src/plugins/BMPReadWriterPlugin/BMPReadWriterPlugin.c +++ b/src/plugins/BMPReadWriterPlugin/BMPReadWriterPlugin.c @@ -1,9 +1,9 @@ /* Automatically generated by - VMPluginCodeGenerator VMMaker.oscog-eem.3024 uuid: 417aa150-be4e-4631-b35b-948afa18e190 + VMPluginCodeGenerator * VMMaker.oscog-eem.3351 uuid: ee0e1c44-4495-48cb-aa70-ca668d8bd20d from - BMPReadWriterPlugin VMMaker.oscog-eem.3024 uuid: 417aa150-be4e-4631-b35b-948afa18e190 + BMPReadWriterPlugin * VMMaker.oscog-eem.3351 uuid: ee0e1c44-4495-48cb-aa70-ca668d8bd20d */ -static char __buildInfo[] = "BMPReadWriterPlugin VMMaker.oscog-eem.3024 uuid: 417aa150-be4e-4631-b35b-948afa18e190 " __DATE__ ; +static char __buildInfo[] = "BMPReadWriterPlugin * VMMaker.oscog-eem.3351 uuid: ee0e1c44-4495-48cb-aa70-ca668d8bd20d " __DATE__ ; #include "config.h" @@ -67,7 +67,7 @@ extern sqInt stackObjectValue(sqInt offset); extern #endif struct VirtualMachine* interpreterProxy; -static const char *moduleName = "BMPReadWriterPlugin VMMaker.oscog-eem.3024 " INT_EXT; +static const char *moduleName = "BMPReadWriterPlugin * VMMaker.oscog-eem.3351 " INT_EXT; @@ -119,7 +119,7 @@ primitiveRead24BmpLine(void) formBits = firstIndexableField(formBitsOop); pixelLineSize = slotSizeOf(pixelLineOop); pixelLine = firstIndexableField(pixelLineOop); - if (!(((formBitsIndex + width) <= formBitsSize) + if (!((((formBitsIndex + width) - 1) <= formBitsSize) && ((width * 3) <= pixelLineSize))) { return primitiveFail(); } @@ -174,7 +174,7 @@ primitiveWrite24BmpLine(void) formBits = firstIndexableField(formBitsOop); pixelLineSize = slotSizeOf(pixelLineOop); pixelLine = firstIndexableField(pixelLineOop); - if (!(((formBitsIndex + width) <= formBitsSize) + if (!((((formBitsIndex + width) - 1) <= formBitsSize) && ((width * 3) <= pixelLineSize))) { return primitiveFail(); }