Commit f9dc052
fix: Resolve IDisposable memory leaks in image source strategies (#36)
* fix: Resolve IDisposable memory leaks in image source strategies
- Fix Mat object disposal in FileImageSourceStrategy when empty frames/images
- Fix Mat object disposal in CameraImageSourceStrategy when empty frames
- Add proper exception handling with disposal in GetImageFrameAsync
- Prevents OpenCV Mat memory leaks identified by CodeQL analysis
Resolves #35
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: Add comprehensive exception handling for Mat disposal
- Wrap frame operations in try-catch blocks to ensure disposal
- Prevent memory leaks when Read() or Empty() methods throw exceptions
- Address GitHub Advanced Security Bot recommendations
- Improve robustness of OpenCV resource management
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Stephen Theodore <wssmash93@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>1 parent 62e6e16 commit f9dc052
File tree
3 files changed
+34
-11
lines changed- .claude
- src/MetaExtractor.Infrastructure/Services
3 files changed
+34
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| |||
Lines changed: 13 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
82 | 90 | | |
83 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
84 | 94 | | |
| 95 | + | |
85 | 96 | | |
86 | 97 | | |
87 | | - | |
88 | | - | |
89 | 98 | | |
90 | 99 | | |
91 | 100 | | |
| |||
Lines changed: 18 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
61 | 69 | | |
62 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
63 | 73 | | |
| 74 | + | |
64 | 75 | | |
65 | 76 | | |
66 | | - | |
67 | | - | |
68 | 77 | | |
69 | 78 | | |
70 | 79 | | |
| |||
76 | 85 | | |
77 | 86 | | |
78 | 87 | | |
79 | | - | |
| 88 | + | |
| 89 | + | |
80 | 90 | | |
81 | 91 | | |
82 | | - | |
| 92 | + | |
83 | 93 | | |
84 | 94 | | |
85 | 95 | | |
| 96 | + | |
86 | 97 | | |
87 | 98 | | |
88 | 99 | | |
89 | 100 | | |
90 | 101 | | |
91 | 102 | | |
92 | 103 | | |
| 104 | + | |
93 | 105 | | |
94 | 106 | | |
95 | 107 | | |
| |||
0 commit comments