16 bit signed integers have a range of [-32768, 32768). The existing code
was using the interval (-32768, 32768) instead. This patch fixes that.
Review: https://reviewboard.asterisk.org/r/2479/
........
Merged revisions 386929 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 386930 from http://svn.asterisk.org/svn/asterisk/branches/11
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@386931
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
res = (int) *input + *value;
if (res > 32767)
*input = 32767;
- else if (res < -32767)
- *input = -32767;
+ else if (res < -32768)
+ *input = -32768;
else
*input = (short) res;
}
res = (int) *input - *value;
if (res > 32767)
*input = 32767;
- else if (res < -32767)
- *input = -32767;
+ else if (res < -32768)
+ *input = -32768;
else
*input = (short) res;
}
res = (int) *input * *value;
if (res > 32767)
*input = 32767;
- else if (res < -32767)
- *input = -32767;
+ else if (res < -32768)
+ *input = -32768;
else
*input = (short) res;
}