Re: [FFmpeg-devel] [PATCH 2/3] wavpackenc: report too small buffer

2014-08-21 Thread Michael Niedermayer
On Thu, Aug 21, 2014 at 02:32:46PM +0200, Christophe Gisquet wrote: > Hi, > > 2014-08-19 18:28 GMT+02:00 Christophe Gisquet : > > 2014-08-19 16:20 GMT+02:00 Nicolas George : > >> IMHO, the correct error depends on how sure you are that a buffer too small > >> SHOULD not happen. > >> > >> If you ar

Re: [FFmpeg-devel] [PATCH 2/3] wavpackenc: report too small buffer

2014-08-21 Thread Christophe Gisquet
Hi, 2014-08-19 18:28 GMT+02:00 Christophe Gisquet : > 2014-08-19 16:20 GMT+02:00 Nicolas George : >> IMHO, the correct error depends on how sure you are that a buffer too small >> SHOULD not happen. >> >> If you are very sure, then av_assert0(). > > That would be it: I'm sure that, if the conditio

Re: [FFmpeg-devel] [PATCH 2/3] wavpackenc: report too small buffer

2014-08-19 Thread Christophe Gisquet
Hi, 2014-08-19 16:20 GMT+02:00 Nicolas George : > IMHO, the correct error depends on how sure you are that a buffer too small > SHOULD not happen. > > If you are very sure, then av_assert0(). That would be it: I'm sure that, if the condition occurs and the packet is written anyway, the file will

Re: [FFmpeg-devel] [PATCH 2/3] wavpackenc: report too small buffer

2014-08-19 Thread Nicolas George
Le duodi 2 fructidor, an CCXXII, Christophe Gisquet a écrit : > >> +return AVERROR_INVALIDDATA; > > Shouldn't this be AVERROR_BUG? > This was selected as a default, not knowing exactly what to put here. > There's even a AVERROR_BUFFER_TOO_SMALL, but I though it would be used > for user-prov

Re: [FFmpeg-devel] [PATCH 2/3] wavpackenc: report too small buffer

2014-08-19 Thread Christophe Gisquet
Hi, 2014-08-19 16:06 GMT+02:00 Timothy Gu : >> +return AVERROR_INVALIDDATA; > > Shouldn't this be AVERROR_BUG? This was selected as a default, not knowing exactly what to put here. There's even a AVERROR_BUFFER_TOO_SMALL, but I though it would be used for user-provided buffers. -- Chris

Re: [FFmpeg-devel] [PATCH 2/3] wavpackenc: report too small buffer

2014-08-19 Thread Timothy Gu
On Tue, Aug 19, 2014 at 5:26 AM, Christophe Gisquet wrote: > bytestream2_* will not cause buffer overflow, but on the other hand, > it should be checked whether overflows have been prevented. > --- > libavcodec/wavpackenc.c | 5 + > 1 file changed, 5 insertions(+) [...] > +return AVER

Re: [FFmpeg-devel] [PATCH 2/3] wavpackenc: report too small buffer

2014-08-19 Thread Paul B Mahol
On 8/19/14, Christophe Gisquet wrote: > bytestream2_* will not cause buffer overflow, but on the other hand, > it should be checked whether overflows have been prevented. > --- > libavcodec/wavpackenc.c | 5 + > 1 file changed, 5 insertions(+) > > diff --git a/libavcodec/wavpackenc.c b/libavc