openh264/codec/encoder/core
Martin Storsjö 98bad4f2b3 Don't manually null terminate after calling SNPRINTF
The following pattern is unsafe on all platforms:
 n = SNPRINTF(buf, ...);
 buf[n] = '\0';

On windows, the _snprintf variants return a negative number
if the buffer was too small, thus buf[n] would be outside
of (before the start of) the buffer.

On other platforms, the C99 snprintf function returns the
total number of characters which would have been written if
the buffer had been large enough, which can be larger than
the buffer size itself, and thus buf[n] would be beyond the
end of the buffer.

The C99 snprintf function always null terminate the buffer.
These invocations of SNPRINTF are within !WIN32, so we can
be sure that the SNPRINTF call itself already null terminated
the buffer.
2014-01-27 08:03:56 +02:00
..
asm Allow yasm to be used instead of nasm. 2014-01-18 13:59:24 +01:00
inc Make the function signatures actually match when used as function pointer 2014-01-24 14:51:44 +02:00
src Don't manually null terminate after calling SNPRINTF 2014-01-27 08:03:56 +02:00