From af3245b47e358f3e02f7996b551f309dfc370416 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 27 Apr 2014 19:31:37 +0200 Subject: [PATCH] movieplayer: memset() with zero length is useless --- src/gui/movieplayer.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 935f39b88..491cfd5b7 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -3,7 +3,7 @@ Movieplayer (c) 2003, 2004 by gagga Based on code by Dirch, obi and the Metzler Bros. Thanks. - (C) 2011 Stefan Seyfried + (C) 2010-2014 Stefan Seyfried Copyright (C) 2011 CoolStream International Ltd @@ -1489,12 +1489,11 @@ bool CMoviePlayerGui::convertSubtitle(std::string &text) size_t ilen = text.length(); size_t olen = ilen*4; size_t len = olen; - char * buf = (char *) malloc(olen+1); + char * buf = (char *) calloc(olen + 1, 1); if (buf == NULL) { iconv_close(cd); return ret; } - memset(buf, olen+1, 0); char * out = buf; char * in = (char *) text.c_str(); if (iconv(cd, &in, &ilen, &out, &olen) == (size_t)-1) {