[PR #1206] [FIX] Fix minor memory leak in OCR code #2004

Open
opened 2026-01-29 17:19:43 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/CCExtractor/ccextractor/pull/1206

State: closed
Merged: Yes


In raising this pull request, I confirm the following (please check boxes):

  • I have read and understood the contributors guide.
  • I have checked that another pull request for this purpose does not exist.
  • I have considered, and confirmed that this submission will be valuable to others.
  • I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  • I give this submission freely, and claim no ownership to its content.
  • I have mentioned this change in the changelog.

My familiarity with the project is as follows (check one):

  • I absolutely love CCExtractor, but have not contributed previously.

This leak was detected by Valgrind:

==1203168== 2,880 bytes in 57 blocks are definitely lost in loss record 3 of 4
==1203168==    at 0x483877F: malloc (vg_replace_malloc.c:309)
==1203168==    by 0x51ADBEE: strdup (in /usr/lib/libc-2.30.so)
==1203168==    by 0x24D1F8: ocr_bitmap (ocr.c:569)
==1203168==    by 0x24E25B: ocr_rect (ocr.c:907)
==1203168==    by 0x284832: write_dvb_sub (dvb_subtitle_decoder.c:1665)
==1203168==    by 0x284B7A: dvbsub_handle_display_segment (dvb_subtitle_decoder.c:1720)
==1203168==    by 0x285024: dvbsub_decode (dvb_subtitle_decoder.c:1828)
==1203168==    by 0x2406AF: process_data (general_loop.c:648)
==1203168==    by 0x2416D0: general_loop (general_loop.c:1025)
==1203168==    by 0x1AC89A: api_start (ccextractor.c:214)
==1203168==    by 0x16EC03: main (ccextractor.c:536)
**Original Pull Request:** https://github.com/CCExtractor/ccextractor/pull/1206 **State:** closed **Merged:** Yes --- **In raising this pull request, I confirm the following (please check boxes):** - [x] I have read and understood the [contributors guide](https://github.com/CCExtractor/ccextractor/blob/master/.github/CONTRIBUTING.md). - [x] I have checked that another pull request for this purpose does not exist. - [x] I have considered, and confirmed that this submission will be valuable to others. - [x] I accept that this submission may not be used, and the pull request closed at the will of the maintainer. - [x] I give this submission freely, and claim no ownership to its content. - [x] **I have mentioned this change in the [changelog](https://github.com/CCExtractor/ccextractor/blob/master/docs/CHANGES.TXT).** **My familiarity with the project is as follows (check one):** - [x] I absolutely love CCExtractor, but have not contributed previously. --- This leak was detected by Valgrind: ``` ==1203168== 2,880 bytes in 57 blocks are definitely lost in loss record 3 of 4 ==1203168== at 0x483877F: malloc (vg_replace_malloc.c:309) ==1203168== by 0x51ADBEE: strdup (in /usr/lib/libc-2.30.so) ==1203168== by 0x24D1F8: ocr_bitmap (ocr.c:569) ==1203168== by 0x24E25B: ocr_rect (ocr.c:907) ==1203168== by 0x284832: write_dvb_sub (dvb_subtitle_decoder.c:1665) ==1203168== by 0x284B7A: dvbsub_handle_display_segment (dvb_subtitle_decoder.c:1720) ==1203168== by 0x285024: dvbsub_decode (dvb_subtitle_decoder.c:1828) ==1203168== by 0x2406AF: process_data (general_loop.c:648) ==1203168== by 0x2416D0: general_loop (general_loop.c:1025) ==1203168== by 0x1AC89A: api_start (ccextractor.c:214) ==1203168== by 0x16EC03: main (ccextractor.c:536) ```
claunia added the pull-request label 2026-01-29 17:19:43 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#2004