diff mbox series

[FFmpeg-devel,4/5] avfilter/ocr: add null check

Message ID MN2PR04MB5981175EB760C6EEA6BE7B8EBAB79@MN2PR04MB5981.namprd04.prod.outlook.com
State New
Headers show
Series [FFmpeg-devel,1/5] avfilter/avfilter: Add avfilter_alloc() and avfilter_query_formats() for initializing filters without a graph | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Soft Works Oct. 13, 2021, 4:50 a.m. UTC
Signed-off-by: softworkz <softworkz@hotmail.com>
---
 libavfilter/vf_ocr.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libavfilter/vf_ocr.c b/libavfilter/vf_ocr.c
index f6249e61fc..a8be529033 100644
--- a/libavfilter/vf_ocr.c
+++ b/libavfilter/vf_ocr.c
@@ -115,8 +115,10 @@  static av_cold void uninit(AVFilterContext *ctx)
 {
     OCRContext *s = ctx->priv;
 
-    TessBaseAPIEnd(s->tess);
-    TessBaseAPIDelete(s->tess);
+    if (s->tess) {
+        TessBaseAPIEnd(s->tess);
+        TessBaseAPIDelete(s->tess);
+    }
 }
 
 AVFILTER_DEFINE_CLASS(ocr);