Closed comeradealexi closed 7 years ago
Global variables are initialized to zero in C. Is there any real-world case where you hit this bug?
Ah, interesting. I was using parts of the sample program to put into a C++ project, I never knew this difference existed between C++ and C!
Might help others like myself being caught out in the future if it was explicitly initialised, even though it's not a C bug :)
Alex
IIRC there are other issues with compiling theora as C++ instead of C. Perhaps we should
#if defined(__cplusplus)
#error Theora must be compiled as C, not C++!
#endif
everywhere?
Applied with corresponding changes to the other examples and an updated commit message in 91203fdfdc0eb06cd87409d47e35d9ee5471a90f.
If these pointers aren't zero, then the sample will crash.
Test for yourself by putting a random value into these pointers.