[FFmpeg-devel] [PATCH] [RFC] avoid _vscnprintf since it exists only since WinXP.

Nicolas George nicolas.george at normalesup.org
Sun Jul 22 22:00:17 CEST 2012

Le quintidi 5 thermidor, an CCXX, Reimar Döffinger a écrit :
> Well, it actually removes some code that seems completely unnecessary.
> To I believe the code would be nicer and simpler if it didn't rely on
> the vsnprintf return value at all, or at least used it only as a hint.

There are two issues for that:

First, one of the design features of bprintf is to be able to compute the
size of the contents even beyond the size limit on the buffer. If we drop
this feature (only used in avfilter_graph_dump() AFAIK, and easily
replaced), it is less of a problem.

Second, doubling the buffer until vsnprintf stops returning an error is
risky since there may be other reasons for vsnprintf to return an error than
a buffer too small: in that case, the error will never go away and the
buffer will double until INT_MAX.


  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120722/e16b038d/attachment.asc>

More information about the ffmpeg-devel mailing list