theora in VTK 8.2.0 produces an error

I’m using VTK 8.2.0 with Visual Studio 2017.
When using debug build of VTK, an error about use of an uninitialized variable was detected at line 326 in “ThirdParty\theora\vtktheora\lib\analyze.c” as follows:

static void oc_fr_state_advance_block(oc_fr_state *_fr,int _b_coded){
  ptrdiff_t bits;
  int       b_coded_count;
  int       b_count;
  int       sb_partial;
  int       sb_full=sb_full; // this line uses "sb_full" before the initialization

How can I fix it ?

1 Like

Hmm. This is a pattern used to “trick” the compiler into thinking the variable is actually initialized. I think you can replace it with sb_full=0 for now. Theora upstream is pretty dead these days, so before going too far on the “let’s fix all the warnings in libtheora”, maybe we should discuss what to do about it.

1 Like