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

2015-04-19 Thread Thilo Borgmann
Am 19.04.15 um 00:49 schrieb Michael Niedermayer: > On Sun, Apr 19, 2015 at 12:20:01AM +0200, Andreas Cadhalpun wrote: >> On 18.04.2015 23:34, Michael Niedermayer wrote: >>> On Sat, Apr 18, 2015 at 10:28:53PM +0200, Andreas Cadhalpun wrote: I don't think an assert would be good here. If you wa

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

2015-04-18 Thread Michael Niedermayer
On Sun, Apr 19, 2015 at 12:20:01AM +0200, Andreas Cadhalpun wrote: > On 18.04.2015 23:34, Michael Niedermayer wrote: > > On Sat, Apr 18, 2015 at 10:28:53PM +0200, Andreas Cadhalpun wrote: > >> I don't think an assert would be good here. If you want to protect against > >> future code changes, I wou

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

2015-04-18 Thread Andreas Cadhalpun
On 18.04.2015 23:34, Michael Niedermayer wrote: > On Sat, Apr 18, 2015 at 10:28:53PM +0200, Andreas Cadhalpun wrote: >> I don't think an assert would be good here. If you want to protect against >> future code changes, I would rather leave the error return. >> But I'd also be fine with dropping thi

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

2015-04-18 Thread Michael Niedermayer
On Sat, Apr 18, 2015 at 10:28:53PM +0200, Andreas Cadhalpun wrote: > On 18.04.2015 21:46, Michael Niedermayer wrote: > > On Sat, Apr 18, 2015 at 09:13:30PM +0200, Andreas Cadhalpun wrote: > >> On 18.04.2015 20:42, Michael Niedermayer wrote: > >>> On Sat, Apr 18, 2015 at 08:13:30PM +0200, Andreas Ca

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

2015-04-18 Thread Andreas Cadhalpun
On 18.04.2015 21:46, Michael Niedermayer wrote: > On Sat, Apr 18, 2015 at 09:13:30PM +0200, Andreas Cadhalpun wrote: >> On 18.04.2015 20:42, Michael Niedermayer wrote: >>> On Sat, Apr 18, 2015 at 08:13:30PM +0200, Andreas Cadhalpun wrote: @@ -1290,8 +1290,16 @@ static int revert_channel_correl

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

2015-04-18 Thread Michael Niedermayer
On Sat, Apr 18, 2015 at 09:13:30PM +0200, Andreas Cadhalpun wrote: > On 18.04.2015 20:42, Michael Niedermayer wrote: > > On Sat, Apr 18, 2015 at 08:13:30PM +0200, Andreas Cadhalpun wrote: > >> @@ -1290,8 +1290,16 @@ static int revert_channel_correlation(ALSDecContext > >> *ctx, ALSBlockData *bd, >

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

2015-04-18 Thread Andreas Cadhalpun
On 18.04.2015 20:42, Michael Niedermayer wrote: > On Sat, Apr 18, 2015 at 08:13:30PM +0200, Andreas Cadhalpun wrote: >> @@ -1290,8 +1290,16 @@ static int revert_channel_correlation(ALSDecContext >> *ctx, ALSBlockData *bd, >> >> if (ch[dep].time_diff_sign) { >> t

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

2015-04-18 Thread Michael Niedermayer
On Sat, Apr 18, 2015 at 08:47:08PM +0200, Michael Niedermayer wrote: > On Sat, Apr 18, 2015 at 08:42:58PM +0200, Michael Niedermayer wrote: > > On Sat, Apr 18, 2015 at 08:13:30PM +0200, Andreas Cadhalpun wrote: > > > On 18.04.2015 20:05, Michael Niedermayer wrote: > > > > On Sat, Apr 18, 2015 at 06

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

2015-04-18 Thread Michael Niedermayer
On Sat, Apr 18, 2015 at 08:42:58PM +0200, Michael Niedermayer wrote: > On Sat, Apr 18, 2015 at 08:13:30PM +0200, Andreas Cadhalpun wrote: > > On 18.04.2015 20:05, Michael Niedermayer wrote: > > > On Sat, Apr 18, 2015 at 06:58:30PM +0200, Andreas Cadhalpun wrote: > > >> If begin is smaller than t, t

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

2015-04-18 Thread Michael Niedermayer
On Sat, Apr 18, 2015 at 08:13:30PM +0200, Andreas Cadhalpun wrote: > On 18.04.2015 20:05, Michael Niedermayer wrote: > > On Sat, Apr 18, 2015 at 06:58:30PM +0200, Andreas Cadhalpun wrote: > >> If begin is smaller than t, the subtraction 'begin -= t' wraps around, > >> because begin is unsigned. The

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

2015-04-18 Thread Andreas Cadhalpun
On 18.04.2015 20:05, Michael Niedermayer wrote: > On Sat, Apr 18, 2015 at 06:58:30PM +0200, 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. >> >> Sig

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

2015-04-18 Thread Michael Niedermayer
On Sat, Apr 18, 2015 at 06:58:30PM +0200, 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. > > Signed-off-by: Andreas Cadhalpun > --- > libavcodec/als

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

2015-04-18 Thread Andreas Cadhalpun
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. Signed-off-by: Andreas Cadhalpun --- libavcodec/alsdec.c | 8 1 file changed, 8 insertions(+) diff --git a/libavcodec/alsdec