[vlc-commits] macosx: fix use after free for video effects string

David Fuhrmann git at videolan.org
Fri Nov 15 18:04:46 CET 2013


vlc/vlc-2.1 | branch: master | David Fuhrmann <david.fuhrmann at googlemail.com> | Thu Nov 14 13:11:29 2013 +0100| [d0aeca74e3fb5802cefc39dd09cb52f061d7213a] | committer: David Fuhrmann

macosx: fix use after free for video effects string

This bug resulted in failure of setting more than one video effect
filter on mavericks.

close #9849
(cherry picked from commit 31b1205fd622eef0be3379f602cf83807c3c2124)

Signed-off-by: David Fuhrmann <david.fuhrmann at googlemail.com>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.1.git/?a=commit;h=d0aeca74e3fb5802cefc39dd09cb52f061d7213a
---

 modules/gui/macosx/VideoEffects.m |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/gui/macosx/VideoEffects.m b/modules/gui/macosx/VideoEffects.m
index 838e4c0..6f413cb 100644
--- a/modules/gui/macosx/VideoEffects.m
+++ b/modules/gui/macosx/VideoEffects.m
@@ -524,8 +524,9 @@ static VLCVideoEffects *_o_sharedInstance = nil;
             free(psz_string);
             psz_string = strdup(psz_name);
         } else if (strstr(psz_string, psz_name) == NULL) {
+            char *psz_tmp = strdup([[NSString stringWithFormat: @"%s:%s", psz_string, psz_name] UTF8String]);
             free(psz_string);
-            psz_string = strdup([[NSString stringWithFormat: @"%s:%s", psz_string, psz_name] UTF8String]);
+            psz_string = psz_tmp;
         }
     } else {
         if (!psz_string)



More information about the vlc-commits mailing list