[vlc-devel] [PATCH] DASH: prevent integer overflow

Frederic YHUEL fyhuel at viotech.net
Mon Feb 27 15:07:46 CET 2012


On Mon, Feb 27, 2012 at 2:04 PM, Hugo Beauzée-Luyssen
<beauze.h at gmail.com> wrote:
> On Mon, Feb 27, 2012 at 2:00 PM, Hugo Beauzée-Luyssen
> <beauze.h at gmail.com> wrote:
>> On Mon, Feb 27, 2012 at 1:51 PM, Frederic YHUEL <fyhuel at viotech.net> wrote:
>>> On Mon, Feb 27, 2012 at 12:39 PM, Jean-Baptiste Kempf <jb at videolan.org> wrote:
>>>> On Thu, Feb 23, 2012 at 06:06:12PM +0100, Frederic YHUEL wrote :
>>>>> But actually, no, even in that case we should be safe.
>>>>
>>>> 10Gbps links exist.
>>>>
>>>
>>> Ok, the patch should probably be applied then :-)
>>>
>>> Best Regards,
>>>
>>
>> Hello,
>>
>> Patch doesn't apply anymore :(
>>
>> Regards,
>>
>
> A few remarks though :
> - I'd rather use a uint64_t rather than a unsigned long long, but I
> don't think it matters anymore.

Ok. I never really understood when we should use one or the other, but
reasoning in terms of uint*_t is simpler.

> - It seems the indentation is wrong

I tried to stick with the same indentation, but it's not consistent
anyway (look at the "if" of this very file for instance)
In general, I find it's tricky in VLC to get a correct indentation,
since each module has a different one.

> - Wouldn't it be simpler just to store the bpsAvg in a uint64 ? I
> haven't check the side effects though.
>

It would probably be cleaner, but when I saw that bpsAvg was
initialized to "-1" somewhere, I opted for this (lazy) solution :-)

I attached a new patch in case you want to apply it.

Best Regards,

-- 
Frédéric
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-DASH-prevent-integer-overflow.patch
Type: text/x-diff
Size: 1943 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20120227/f2a396cf/attachment.patch>


More information about the vlc-devel mailing list