X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fvideo_filter%2Fopencv_example.cpp;h=76b86659fd69e661a94c9a1e0321859f5f2a2a07;hb=588723d7c65ccdb0fa5cc39b3cae132176637300;hp=54a3f4d31a52763aaca3fd82ddd640a245826f28;hpb=ebd3b8f316ef4c114eb5625372f11fd87bd809a5;p=vlc diff --git a/modules/video_filter/opencv_example.cpp b/modules/video_filter/opencv_example.cpp index 54a3f4d31a..76b86659fd 100644 --- a/modules/video_filter/opencv_example.cpp +++ b/modules/video_filter/opencv_example.cpp @@ -34,7 +34,7 @@ # include "config.h" #endif -#include +#include #include #include #include "filter_common.h" @@ -90,8 +90,7 @@ static int OpenFilter( vlc_object_t *p_this ) if( ( p_filter->p_sys = p_sys = (filter_sys_t *)malloc(sizeof(filter_sys_t)) ) == NULL ) { - msg_Err( p_filter, "out of memory" ); - return VLC_EGENERIC; + return VLC_ENOMEM; } //init the video_filter_event_info_t struct @@ -114,6 +113,7 @@ static int OpenFilter( vlc_object_t *p_this ) char* filename = config_GetPsz( p_filter, "opencv-haarcascade-file" ); p_filter->p_sys->p_cascade = (CvHaarClassifierCascade*)cvLoad( filename, 0, 0, 0 ); p_filter->p_sys->p_storage = cvCreateMemStorage(0); + free( filename ); return VLC_SUCCESS; } @@ -206,7 +206,6 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic ) if( NULL == ( p_filter->p_sys->event_info.p_region = (video_filter_region_info_t *)malloc(faces->total*sizeof(video_filter_region_info_t)))) { - msg_Err( p_filter, "out of memory" ); return NULL; } memset(p_filter->p_sys->event_info.p_region, 0, faces->total*sizeof(video_filter_region_info_t));