[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 23:51:30 CEST 2014

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

> Le mardi 10 juin 2014, 22:30:48 David Fuhrmann a écrit :
>> Actually, I’m fine to only committing the first chunk to fix the underflow
>> for a start, as its sufficient for the bug.
> The sign overflow fix is the second chunk.

I fail to see how the first chunk introduces a „refill hack“. Thus I thought you meant the second chunk. If you want to call it a hack, the hack is already there (stream.c lines 1254 up to 1269) and the underflow within the refill function was ignored so far. Additionally, the exact error case I have was already sort of taken into account, with the i_pos >= tk->i_end condition.
As the error path probably was only rarely executed, the problem in this path was undetected up to now. (Note that I also can only reproduce the problem in very strict circumstances.) Now, this is a patch for a proposal for an intermediate solution. If you (or someone else) want to rewrite / fix the whole „hack“ as it is currently in the code, you are welcome to do so. But until then, we should use the proposed patch.

> The sign overflow fix is the second chunk.

And I doubt that only applying the second chunk to all occurences (they are more) is a proper solution. Actually, this would be the real workaround, as the root of the issue is at (or above the first chunk), as it currently stands. And this change might break even more functionality.

With best regards,

More information about the vlc-devel mailing list