Fix out of bound memory access in lppTransposer

In TRANSPOSER_SETTINGS, initialize the whole bwBorders array to a
  reasonable value to guarantee correct termination in while loop
  in lppTransposer function. This fixes the reported bug.
For completeness:
  - clear the whole bwIndex array instead of noOfPatches entries only.
  - abort criterion in while loop to prevent potential
    infinite loop, and limit bwIndex[patch] to a valid range.

Test: see bug for malicious content, decoded with "stagefright -s -a"
Bug: 65280786

Change-Id: I16ed2e1c0f1601926239a652ca20a91284151843
(cherry picked from commit 6d3dd40e204bf550abcfa589bd9615df8778e118)

mapInvfMode (INVF_MODE mode,
             INVF_MODE prevMode,
             WHITENING_FACTORS whFactors)
{
 switch (mode) {
 case INVF_LOW_LEVEL:
 if(prevMode == INVF_OFF)
 return whFactors.transitionLevel;
 else
 return whFactors.lowLevel;

 case INVF_MID_LEVEL:
 return whFactors.midLevel;

 case INVF_HIGH_LEVEL:
 return whFactors.highLevel;

 default:
 if(prevMode == INVF_LOW_LEVEL)
 return whFactors.transitionLevel;
 else
 return whFactors.off;
 }
}

mapInvfMode (INVF_MODE mode,
             INVF_MODE prevMode,
             WHITENING_FACTORS whFactors)
{
 switch (mode) {
 case INVF_LOW_LEVEL:
 if(prevMode == INVF_OFF)
 return whFactors.transitionLevel;
 else
 return whFactors.lowLevel;

 case INVF_MID_LEVEL:
 return whFactors.midLevel;

 case INVF_HIGH_LEVEL:
 return whFactors.highLevel;

 default:
 if(prevMode == INVF_LOW_LEVEL)
 return whFactors.transitionLevel;
 else
 return whFactors.off;
 }
}
