[theora] (no subject)

Gregory Maxwell gmaxwell at gmail.com
Thu Jun 10 14:16:24 PDT 2010


On Thu, Jun 10, 2010 at 5:04 PM, Cristian Adam <cristian.adam at gmail.com> wrote:
> On 10/06/2010 22:52, SAHANA DEVARAJU wrote:
>> hi all,
>>
>> I'm working on theora in v c++ 2008 express. I'm getting the following
>> runtime error for the encoder example.
>> Appreciate all your help.
>>
>> debug Error!
>>
>> Run-time check failure #3- the variable "sb_full" is being used
>> without being initialised
>>
>> regards,
>> sahana
>
> You should disable "Basic Runtime Check" (/RTCu), for both libtheora and
> encoder example
> projects.


It's worth elaborating on this, because I don't want people thinking
that libtheora has known and unfixed problems accessing uninitialized
variables.


In libtheora there are a number of places where an initialization
isn't obvious to a compiler, usually due to cross function boundaries.
Some of these places are performance critical.

In order to suppress compiler warnings in places where they would
incorrectly warn of missing initialization libtheora initializes a
variable to itself. e.g.

int a=a;

This odd looking code causes GCC (for example) to emit nothing at all,
so it's the same as "int a;" but it suppresses the warning.

For some odd reason, the Microsoft tool-chain actually generates code
for the a=a case and then the runtime checker warns on it.  It's a
harmless warning, however.

The valgrind tool we use on GNU/Linux is far more intelligent with
uninitialized access checks and isn't confused by this at all.


More information about the theora mailing list