[vlc-devel] [PATCH] Enable aspectratio parameter in mozilla plugin

Vicente Jiménez googuy at gmail.com
Wed Jun 10 13:30:05 CEST 2009


NOW I attached the corrected patch.

Sorry for the noise :$

On Wed, Jun 10, 2009 at 1:29 PM, Vicente Jiménez<googuy at gmail.com> wrote:
> Thanks for the review!
>
> I've suposed it was C++ code because of the file extension. I was
> looking for similar parameter operations in the code but found none
> and I supposed that the concatenation could be done with +. Thanks for
> the clarifications.
>
> You mean to do:
>            ppsz_argv[ppsz_argc++] = "--aspect-ratio";
>            ppsz_argv[ppsz_argc++] = argv[i];
>
> Is this correct?
>
> I attached a corrected patch.
>
> Best regards
> vicente
>
> On Wed, Jun 10, 2009 at 12:52 PM, <jpd at videolan.org> wrote:
>> On Wed, Jun 10, 2009 at 12:25:08PM +0200, Vicente Jim?nez wrote:
>>> Could somebody review this patch?
>>
>> The indentation is off but more importantly, it'll probably segfault.
>>
>>> +         ppsz_argv[ppsz_argc++] = "--aspect-ratio=" + argv[i];
>>
>> Short answer: The arguments are (const) char *.
>>
>>
>> Long answer: Doing arithmetic on char * will not yield the expected
>> results. The alternative using operator+ would use std::string temporaries
>> and at best generate a memory leak, but more likely a stale pointer. This
>> is C code at heart so concatenating requires an extra, visible, buffer,
>> but you'll be better off not trying to concatenate the strings at all,
>> instead drop the = and use a separate ppsz_argv entry for the argument.
>>
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> http://mailman.videolan.org/listinfo/vlc-devel
>>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Enable-aspectratio-parameter-in-the-mozilla-plugin.patch
Type: application/octet-stream
Size: 983 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20090610/702ca4eb/attachment.obj>


More information about the vlc-devel mailing list