Fix "Dereference of null pointer" compiler warning.
This is attempt #2 to get I1581b3337b6331a694774da27072dd39992e6218 in. Swapping from android/log.h to log/log.h seems to fix the build breakage. Original commit message: This CL fixes the warning: "frameworks/av/media/libstagefright/codecs/aacenc/src/dyn_bits.c:197:35 warning: Array access (from variable 'sideInfoTab') results in a null pointer dereference" There's a switch statement that initializes 'sideInfoTab', and it does not have a default case. The listed cases seem to cover all the valid types for the switch variable, but since the declared type is basically 'int', it's possible for it to contain some value not covered by the other cases, hit the non-existent default case, which leaves sideInfoTab with its initial NULL value, later being dereferenced. This CL fixes this by adding a default case to the switch statement that complains if it gets an invalid value. Bug: 27293041 Test: Compiles without the warning. Successfully built on bullhead, aosp_arm64, and angler. Change-Id: I554bbf266695936830d318540a2aacecf076c652
Loading
Please register or sign in to comment