Fix "Dereference of null pointer" compiler warning.
This CL fixes the warning: "frameworks/av/media/libstagefright/codecs/aacenc/src/dyn_bits.c:197:35 warning: Array access (from variable 'sideInfoTab') resutls 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-existant 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: None Test: Compiles without the warning. Change-Id: I1581b3337b6331a694774da27072dd39992e6218
Loading
Please register or sign in to comment