Commit 083c2a24 authored by David Fuhrmann's avatar David Fuhrmann

macosx: fix a bunch of string memleaks in video effects panel code

parent a3c4d7c7
......@@ -32,6 +32,10 @@
* the translated string. the translation should be '1:translatedstring' though */
#define _ANS(s) [[[VLCStringUtility sharedInstance] localizedString: _(s)] substringFromIndex:2]
#define B64DecNSStr(s) [[VLCStringUtility sharedInstance] b64Decode: s]
#define B64EncAndFree(s) [[VLCStringUtility sharedInstance] b64EncodeAndFree: s]
unsigned int CocoaKeyToVLC(unichar i_key);
@interface VLCStringUtility : NSObject
......@@ -46,4 +50,8 @@ unsigned int CocoaKeyToVLC(unichar i_key);
- (NSString *)VLCKeyToString:(NSString *)theString;
- (unsigned int)VLCModifiersToCocoa:(NSString *)theString;
- (NSString *)b64Decode:(NSString *)string;
- (NSString *)b64EncodeAndFree:(char *)psz_string;
@end
......@@ -26,6 +26,8 @@
#import <vlc_input.h>
#import <vlc_keys.h>
#import <vlc_strings.h>
#import "StringUtility.h"
#import "intf.h"
......@@ -322,4 +324,30 @@ unsigned int CocoaKeyToVLC(unichar i_key)
return theString;
}
- (NSString *)b64Decode:(NSString *)string
{
char *psz_decoded_string = vlc_b64_decode([string UTF8String]);
if(!psz_decoded_string)
return @"";
NSString *returnStr = [NSString stringWithFormat:@"%s", psz_decoded_string];
free(psz_decoded_string);
return returnStr;
}
- (NSString *)b64EncodeAndFree:(char *)psz_string
{
char *psz_encoded_string = vlc_b64_encode(psz_string);
free(psz_string);
if(!psz_encoded_string)
return @"";
NSString *returnStr = [NSString stringWithFormat:@"%s", psz_encoded_string];
free(psz_encoded_string);
return returnStr;
}
@end
......@@ -154,7 +154,7 @@
- (void)setVideoFilter: (char *)psz_name on:(BOOL)b_on;
- (void)setVideoFilterProperty: (char *)psz_name forFilter: (char*)psz_filter integer: (int)i_value;
- (void)setVideoFilterProperty: (char *)psz_name forFilter: (char*)psz_filter float: (float)f_value;
- (void)setVideoFilterProperty: (char *)psz_name forFilter: (char *)psz_filter string: (char *)psz_value;
- (void)setVideoFilterProperty: (char *)psz_name forFilter: (char *)psz_filter string: (const char *)psz_value;
- (void)setVideoFilterProperty: (char *)psz_name forFilter: (char *)psz_filter boolean: (BOOL)b_value;
- (void)saveCurrentProfile;
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment