[FFmpeg-devel] [PATCH] wtvdec: *_to_iso8601: Behave less surprising
michaelni at gmx.at
Sun Jul 1 15:35:07 CEST 2012
On Sun, Jul 01, 2012 at 01:24:13PM +0200, Alexander Strasser wrote:
> Hi Peter,
> Peter Ross wrote:
> > On Sun, Jul 01, 2012 at 02:55:57AM +0200, Alexander Strasser wrote:
> > > Do not violate the (implicit) contract that is indicated by
> > > the arguments of those functions. In other words if buf_size
> > > is passed as zero do not try to write to the buffer's first
> > > element.
> > wtvdec always calls the foo_to_is8601 functions with buf_size > 0.
> > an alternate patch would be to document that expectation (attached).
> as the documentation fix is as long as the code fix and burdens
> the programmer who wants to use those function with reading and
> remembering an additional exception I found the code fix to be nicer.
> I will not insist or argue any more on this matter. I already
> mentioned it is a very local and minor thing. So long discussions
> will not be very productive. Please feel free to proceed in any way
> you feel is best for that code under your maintenance (including the
> option to not change anything in at all).
> Thank you for your timely comments!
btw, a av_assert0() could be added to ensure that if the function
does not support size=0 and never should receive size=0 that noone
passes it by mistake in the future
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
The real ebay dictionary, page 1
"Used only once" - "Some unspecified defect prevented a second use"
"In good condition" - "Can be repaird by experienced expert"
"As is" - "You wouldnt want it even if you were payed for it, if you knew ..."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 198 bytes
Desc: Digital signature
More information about the ffmpeg-devel