[vlc-devel] [PATCH] Avoid calling NSString StringWithUTF8String: with empty (or null) strings.

Andrew Dudman ajdudman at sbcglobal.net
Sun Oct 7 13:26:45 CEST 2012


On Oct 7, 2012, at 5:13 AM, Rémi Denis-Courmont wrote:

> Neither names of encoding can be NULL. This patch does not make sense to me.
> 
> -- 
> Rémi Denis-Courmont
> http://www.remlab.net/
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel

Nice to get such a fast response.

Not sure what you mean.
p_item->list.psz[i_index] can be an empty string.
and if it is, NSString stringWithUTF8String: "" will raise an exception.  See both:

Ticket URL:  <https://trac.videolan.org/vlc/ticket/7539>

https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/Reference/NSString.html#//apple_ref/occ/clm/NSString/stringWithUTF8String:
+ stringWithUTF8String:

I think the empty string comes from modules/codec/subsdec.c, line 45

   41	/*****************************************************************************
   42	 * Module descriptor.
   43	 *****************************************************************************/
   44	static const char *const ppsz_encodings[] = {
   45	    "",
   46	    "system",

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20121007/c5a39603/attachment.html>


More information about the vlc-devel mailing list