Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(171353)

Unified Diff: Lib/test/test_audioop.py

Issue 24456: audioop.adpcm2lin Buffer Over-read
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Modules/audioop.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/test/test_audioop.py Thu Jun 25 23:39:53 2015 +0300
+++ b/Lib/test/test_audioop.py Fri Jun 26 15:39:30 2015 +0300
@@ -273,6 +273,16 @@ class TestAudioop(unittest.TestCase):
# state must be a tuple or None, not an integer
self.assertRaises(TypeError, audioop.adpcm2lin, b'\0', 1, 555)
self.assertRaises(TypeError, audioop.lin2adpcm, b'\0', 1, 555)
+ # Issues #24456, #24457: index out of range
+ self.assertRaises(ValueError, audioop.adpcm2lin, b'\0', 1, (0, -1))
+ self.assertRaises(ValueError, audioop.adpcm2lin, b'\0', 1, (0, 89))
+ self.assertRaises(ValueError, audioop.lin2adpcm, b'\0', 1, (0, -1))
+ self.assertRaises(ValueError, audioop.lin2adpcm, b'\0', 1, (0, 89))
+ # value out of range
+ self.assertRaises(ValueError, audioop.adpcm2lin, b'\0', 1, (-0x8001, 0))
+ self.assertRaises(ValueError, audioop.adpcm2lin, b'\0', 1, (0x8000, 0))
+ self.assertRaises(ValueError, audioop.lin2adpcm, b'\0', 1, (-0x8001, 0))
+ self.assertRaises(ValueError, audioop.lin2adpcm, b'\0', 1, (0x8000, 0))
def test_lin2alaw(self):
self.assertEqual(audioop.lin2alaw(datas[1], 1),
« no previous file with comments | « no previous file | Modules/audioop.c » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+