[vlc-devel] [PATCH] src: input/stream: fix buffer underflow by avoiding inconsistent state in error case
david.fuhrmann at gmail.com
Tue Jun 10 21:30:32 CEST 2014
Am 10.06.2014 um 21:10 schrieb Rémi Denis-Courmont <remi at remlab.net>:
> Le mardi 10 juin 2014, 21:02:46 David Fuhrmann a écrit :
>> Anyway, if you or someone else has more insight of the topic, or better
>> ideas how to fix it, I’m very interested to read them. For now, the patch
>> at least solves the issue I’m experiencing.
> The patch appears ostensibly wrong.
The code is already wrong, as the crash proves it. I do not think this patch makes the code more wrong. Instead, it fixes a quite noticeable issue.
> Why would the offset point to the end of
> the track buffer when refill fails?
I think it makes sense that the offset is corrected from a completely wrong value to the last point where actual data is, as the seek was not done completely, but only to the point where it was still able to read data.
> That does not seem to make sense. And even
> then, why in only one of the cases where refill fails and not the others?
This is not about a failing refill. This is about places in the core where
p_sys->stream.i_offset is set to invalid data. And this is the only place where I identified this issue. Therefore, I corrected the error condition in the revised patch so that its also executed if refill does not fail.
With best regards,
More information about the vlc-devel