Opened 16 years ago
Last modified 14 years ago
#1352 new defect
libvo/vo_dxr2.c:318: Memory leak: img
Reported by: | Owned by: | reimar | |
---|---|---|---|
Priority: | normal | Component: | vo |
Version: | HEAD | Severity: | normal |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Reproduced by developer: | no | Analyzed by developer: | no |
Description
In file libvo/vo_dxr2.c:318:
Variable img leaks memory if 0 is returned:
uint8_t* img = malloc(vo_screenwidth*vo_screenheight*3);
uint8_t* src[] = { img, NULL, NULL };
int stride[] = { vo_screenwidth * 3 , 0, 0 };
int cc = vo_config_count;
memset(img,255,vo_screenwidth*vo_screenheight*3);
vo_config_count = sub_config_count;
if(sub_vo->config(vo_screenwidth,vo_screenheight,vo_screenwidth,vo_screenheight,
VOFLAG_FULLSCREEN ,"DXR2 sub vo",IMGFMT_BGR24) != 0) {
mp_msg(MSGT_VO,MSGL_WARN,"VO: [dxr2] sub vo config failed => No overlay\n");
sub_vo->uninit();
sub_vo = NULL;
use_ol = 0;
vo_config_count = cc;
return 0;
}
This bug was found using cppcheck: http://cppcheck.wiki.sourceforge.net/