From 885c6a2610619ad3ee2b01ae7ec7670f8551d388 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 6 May 2013 20:58:54 +0200 Subject: Fix some cppcheck / scan-build warnings These were found by the cppcheck and scan-build static analyzers. Most of these aren't interesting (the 2 previous commits fix some interesting cases found by these analyzers), and they don't nearly fix all warnings. (Most of the unfixed warnings are spam, things MPlayer never cared about, or false positives.) --- video/filter/vf_hqdn3d.c | 2 +- video/filter/vf_yadif.c | 2 +- video/out/vo_opengl_old.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'video') diff --git a/video/filter/vf_hqdn3d.c b/video/filter/vf_hqdn3d.c index 4f49f12715..c5d99b2ace 100644 --- a/video/filter/vf_hqdn3d.c +++ b/video/filter/vf_hqdn3d.c @@ -62,7 +62,7 @@ static int config(struct vf_instance *vf, unsigned int flags, unsigned int outfmt){ uninit(vf); - vf->priv->Line = malloc(width*sizeof(int)); + vf->priv->Line = malloc(width*sizeof(unsigned int)); return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt); } diff --git a/video/filter/vf_yadif.c b/video/filter/vf_yadif.c index 01c3787048..017e7c515c 100644 --- a/video/filter/vf_yadif.c +++ b/video/filter/vf_yadif.c @@ -393,7 +393,7 @@ static int config(struct vf_instance *vf, vf->priv->stride[i]= w; for(j=0; j<3; j++) - vf->priv->ref[j][i]= (char *)malloc(w*h*sizeof(uint8_t))+3*w; + vf->priv->ref[j][i]= (char *)malloc(w*h)+3*w; } return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt); diff --git a/video/out/vo_opengl_old.c b/video/out/vo_opengl_old.c index 7556bccdff..cd92acfaa0 100644 --- a/video/out/vo_opengl_old.c +++ b/video/out/vo_opengl_old.c @@ -565,7 +565,7 @@ static void replace_var_char(char **text, const char *name, char replace) // Append template to *text. Possibly initialize *text if it's NULL. static void append_template(char **text, const char* template) { - if (!text) + if (!*text) *text = talloc_strdup(NULL, template); else *text = talloc_strdup_append(*text, template); -- cgit v1.2.3