File tree Expand file tree Collapse file tree
core/src/main/java/app/photofox/vipsffm
generator/src/main/kotlin/vipsffm Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ repositories {
2323}
2424
2525dependencies {
26- implementation(" app.photofox.vips-ffm:vips-ffm-core:1.9.6 " )
26+ implementation(" app.photofox.vips-ffm:vips-ffm-core:1.9.7 " )
2727}
2828```
2929
Original file line number Diff line number Diff line change 11plugins {
2- kotlin(" jvm" ) version " 2.3.0 " apply false
2+ kotlin(" jvm" ) version " 2.3.21 " apply false
33}
Original file line number Diff line number Diff line change @@ -10454,7 +10454,14 @@ public VBlob getBlob(String name) {
1045410454 if (!VipsValidation.isValidPointer(outPointer)) {
1045510455 throw new VipsError("failed to read value of type blob from field: " + name);
1045610456 }
10457- var blobAddress = outPointer.get(VipsRaw.C_POINTER, 0);
10457+ if (!VipsValidation.isValidPointer(outLengthPointer)) {
10458+ throw new VipsError("failed to read length pointer of type blob from field: " + name);
10459+ }
10460+ var blobLength = outLengthPointer.get(VipsRaw.C_LONG, 0);
10461+ if (blobLength <= 0) {
10462+ throw new VipsError("failed to read length of type blob from field: " + name);
10463+ }
10464+ var blobAddress = outPointer.get(VipsRaw.C_POINTER, 0).reinterpret(blobLength);
1045810465 return new VBlob(arena, blobAddress);
1045910466 }
1046010467
Original file line number Diff line number Diff line change @@ -1072,7 +1072,22 @@ object GenerateVClasses {
10721072
10731073 vblobType -> {
10741074 // void **
1075- this .addStatement(" var blobAddress = outPointer.get(\$ T.C_POINTER, 0)" , vipsRawType)
1075+ this .addCode(
1076+ CodeBlock .builder()
1077+ .beginControlFlow(" if (!\$ T.isValidPointer(outLengthPointer))" , vipsValidatorType)
1078+ .addStatement(" throw new VipsError(\" failed to read length pointer of type $typeName from field: \" + name)" )
1079+ .endControlFlow()
1080+ .build()
1081+ )
1082+ this .addStatement(" var blobLength = outLengthPointer.get(\$ T.C_LONG, 0)" , vipsRawType)
1083+ this .addCode(
1084+ CodeBlock .builder()
1085+ .beginControlFlow(" if (blobLength <= 0)" )
1086+ .addStatement(" throw new VipsError(\" failed to read length of type $typeName from field: \" + name)" )
1087+ .endControlFlow()
1088+ .build()
1089+ )
1090+ this .addStatement(" var blobAddress = outPointer.get(\$ T.C_POINTER, 0).reinterpret(blobLength)" , vipsRawType)
10761091 this .addStatement(" return new VBlob(arena, blobAddress)" )
10771092 }
10781093
You can’t perform that action at this time.
0 commit comments