[vlc-devel] [PATCH] src: input/stream: fix buffer underflow by avoiding inconsistent state in error case

David Fuhrmann david.fuhrmann at gmail.com
Tue Jun 10 22:12:34 CEST 2014


Am 10.06.2014 um 21:48 schrieb Rémi Denis-Courmont <remi at remlab.net>:

> Le mardi 10 juin 2014, 21:30:32 David Fuhrmann a écrit :
>> The code is already wrong, as the crash proves it.
> 
> The crash proves that something is wrong on your system, with a strong 
> suspicion toward the VLC code base. It does not prove that the stream cache is 
> wrong (not to say it's not wrong).

Indeed. But seeing that my patch seems to solve the crash, it is fair to assume that there is an actual problem within the stream cache code.

> 
>> I do not think this patch
>> makes the code more wrong.
> 
> I think it does make the problem even more confusing for the reasons already 
> outlined.

In my opinion, as a start this patch actually makes the reader aware that there might be a problem with an unsigned underflow at this place. This is currently not easily spottable at all, because of the definition of the variable types at different places. Additionally, I also can add some comments, if you think its too confusing.
And finally, it fixes a bug and thus I propose to commit the fix, even if it might not be the absolutely best solution.

In any way, I would also like to get some (maybe more detailed) comments / opinions from the other developers, if someone has some insight in this part of the code.

With best regards,
David


More information about the vlc-devel mailing list