openh264 icon indicating copy to clipboard operation
openh264 copied to clipboard

gcc 4.9.2/5.1.0 detects uninitialized variable in codec/decoder/core/src/mv_pred.cpp when compiling tests

Open ikorolev93 opened this issue 11 years ago • 3 comments

codec/decoder/core/src/mv_pred.cpp: In function ‘void WelsDec::PredPSkipMvFromNeighbor(WelsDec::PDqLayer, int16_t*)’:
codec/decoder/core/src/mv_pred.cpp:158:51: error: ‘iLeftTopXy’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
     ST32 (iMvD, LD32 (pCurLayer->pMv[0][iLeftTopXy][15]));
                                                   ^
codec/decoder/core/src/mv_pred.cpp:99:71: error: ‘iLeftXy’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
   iLeftType = ((iCurX != 0 && bLeftAvail) ? pCurLayer->pMbType[iLeftXy] : 0);
                                                                       ^
cc1plus: all warnings being treated as errors

Full output: https://gist.github.com/b9717bb9f32c43d15209 It works with gcc-4.8.4 and clang 3.6.0/3.6.1.

ikorolev93 avatar Jun 28 '15 22:06 ikorolev93

Actually, gcc 5.1.0 doesn't detect second one, only the first (iLeftTopXy). Might be gcc bug?

ikorolev93 avatar Jun 29 '15 01:06 ikorolev93

@HaiboZhu

sijchen avatar Jun 29 '15 02:06 sijchen

This bug has been fixed in #2535 and no warnings output on newest GCC 5.4, close this issue.

HaiboZhu avatar Aug 04 '16 01:08 HaiboZhu