Skip to content

Commit

Permalink
BMPReadWriterPlugin generated source per VMMaker-dtl.442.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
David T Lewis committed Mar 18, 2024
1 parent 558dd51 commit ca5548d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions 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"
Expand Down Expand Up @@ -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;



Expand Down Expand Up @@ -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();
}
Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit ca5548d

Please sign in to comment.