Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/src/imgcodecs/imgcodecs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ Uint8List imencode(
if (!success.value) {
throw CvException(ErrorCode.StsError.code, msg: "imencode failed, check your params");
}
calloc.free(cExt);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rainyl shouldn't the free happen before the success.value check? currently cExt wont be freed if imencode fails

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, you are right, will be fixed soon

return VecUChar.fromPointer(buffer).toU8List();
}

Expand Down