Skip to content

Commit 6fe612d

Browse files
cfsmp3claude
andcommitted
fix: Guard ocr_text access with ENABLE_OCR preprocessor check
The ocr_text field in struct cc_bitmap is only defined when ENABLE_OCR is set. Wrap the free() calls with #ifdef ENABLE_OCR to fix build failures in non-OCR configurations. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 2930c61 commit 6fe612d

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/lib_ccx/matroska.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,8 +1515,10 @@ static void process_vobsub_track_ocr(struct matroska_ctx *mkv_ctx, struct matros
15151515
free(rect[j].data0);
15161516
if (rect[j].data1)
15171517
free(rect[j].data1);
1518+
#ifdef ENABLE_OCR
15181519
if (rect[j].ocr_text)
15191520
free(rect[j].ocr_text);
1521+
#endif
15201522
}
15211523
free(sub.data);
15221524
}

src/lib_ccx/mp4.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,8 +524,10 @@ static int process_vobsub_track(struct lib_ccx_ctx *ctx, GF_ISOFile *f, u32 trac
524524
free(rect[j].data0);
525525
if (rect[j].data1)
526526
free(rect[j].data1);
527+
#ifdef ENABLE_OCR
527528
if (rect[j].ocr_text)
528529
free(rect[j].ocr_text);
530+
#endif
529531
}
530532
free(vob_sub.data);
531533
}

0 commit comments

Comments
 (0)