Re: [FFmpeg-devel] [libav-devel] [PATCH] alsdec: validate time diff index

2015-04-22 Thread Michael Niedermayer
On Wed, Apr 22, 2015 at 10:59:29AM +0200, Thilo Borgmann wrote: Am 21.04.15 um 19:35 schrieb Andreas Cadhalpun: On 21.04.2015 08:14, Thilo Borgmann wrote: Am 20.04.15 um 23:20 schrieb Andreas Cadhalpun: On 19.04.2015 22:20, Luca Barbato wrote: I'd check that `master` is always between

Re: [FFmpeg-devel] [libav-devel] [PATCH] alsdec: validate time diff index

2015-04-22 Thread Thilo Borgmann
Am 21.04.15 um 19:35 schrieb Andreas Cadhalpun: On 21.04.2015 08:14, Thilo Borgmann wrote: Am 20.04.15 um 23:20 schrieb Andreas Cadhalpun: On 19.04.2015 22:20, Luca Barbato wrote: I'd check that `master` is always between `raw_buffer` and the end of it. You mean something like the attached

Re: [FFmpeg-devel] [libav-devel] [PATCH] alsdec: validate time diff index

2015-04-21 Thread Thilo Borgmann
Am 20.04.15 um 23:20 schrieb Andreas Cadhalpun: On 19.04.2015 22:20, Luca Barbato wrote: On 18/04/15 18:58, Andreas Cadhalpun wrote: If begin is smaller than t, the subtraction 'begin -= t' wraps around, because begin is unsigned. The same applies for end t. This causes segmentation faults.

Re: [FFmpeg-devel] [libav-devel] [PATCH] alsdec: validate time diff index

2015-04-21 Thread Andreas Cadhalpun
On 21.04.2015 08:14, Thilo Borgmann wrote: Am 20.04.15 um 23:20 schrieb Andreas Cadhalpun: On 19.04.2015 22:20, Luca Barbato wrote: I'd check that `master` is always between `raw_buffer` and the end of it. You mean something like the attached patch? (I'm not sure if `div_blocks` is

Re: [FFmpeg-devel] [libav-devel] [PATCH] alsdec: validate time diff index

2015-04-20 Thread Andreas Cadhalpun
On 19.04.2015 22:20, Luca Barbato wrote: On 18/04/15 18:58, Andreas Cadhalpun wrote: If begin is smaller than t, the subtraction 'begin -= t' wraps around, because begin is unsigned. The same applies for end t. This causes segmentation faults. Actually, the access to raw_buffer seems a

Re: [FFmpeg-devel] [libav-devel] [PATCH] alsdec: validate time diff index

2015-04-18 Thread Andreas Cadhalpun
On 18.04.2015 21:55, Luca Barbato wrote: On 18/04/15 18:58, Andreas Cadhalpun wrote: If begin is smaller than t, the subtraction 'begin -= t' wraps around, because begin is unsigned. The same applies for end t. Why that variable is unsigned? Probably because it should never be negative.