Repository navigation
Commit 6c9a732
committed
[#20986][fix] Check the audio header before decoding
Reject audio whose header reports more than _MAX_AUDIO_SAMPLES samples
before any samples are read, so an oversized file never allocates the
read buffer. The bounded read stays for files of unknown length.
Decode AudioMediaIO.load_base64 input with _decode_base64_with_limit,
which bounds the encoded string before decoding.
Drop the max(channels, 1) guard because libsndfile refuses to open a
file with fewer than one channel.
Tests use nonzero samples that differ per channel, cover the header
check, the unknown-length fallback and the base64 limit, and
test_media_io.py is added to l0_cpu.yml.
Signed-off-by: LeizhenZhang <zhangleizhen645@gmail.com>1 parent f7dd099 commit 6c9a732
3 files changed
Lines changed: 70 additions & 18 deletions
File tree
- tensorrt_llm/inputs
- tests
- integration/test_lists/test-db
- unittest/llmapi/apps
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
112 | | - | |
113 | | - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
116 | 120 | | |
117 | 121 | | |
118 | 122 | | |
| |||
887 | 891 | | |
888 | 892 | | |
889 | 893 | | |
890 | | - | |
891 | | - | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
892 | 898 | | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
893 | 903 | | |
894 | | - | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
895 | 908 | | |
896 | 909 | | |
897 | 910 | | |
898 | | - | |
899 | | - | |
900 | | - | |
901 | | - | |
| 911 | + | |
902 | 912 | | |
903 | 913 | | |
904 | 914 | | |
| |||
1133 | 1143 | | |
1134 | 1144 | | |
1135 | 1145 | | |
1136 | | - | |
| 1146 | + | |
1137 | 1147 | | |
1138 | 1148 | | |
1139 | 1149 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
| 207 | + | |
207 | 208 | | |
208 | 209 | | |
209 | 210 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
102 | 107 | | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
| 108 | + | |
110 | 109 | | |
111 | 110 | | |
112 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
113 | 121 | | |
114 | 122 | | |
115 | 123 | | |
| |||
119 | 127 | | |
120 | 128 | | |
121 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
122 | 143 | | |
123 | 144 | | |
124 | 145 | | |
| |||
147 | 168 | | |
148 | 169 | | |
149 | 170 | | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
150 | 191 | | |
151 | 192 | | |
152 | 193 | | |
| |||
0 commit comments