Commit 9fddaab
fix(security): Add bounds checks for buffer overflow vulnerabilities
Fixes two buffer overflow vulnerabilities reported in issues #1427 and #1428:
- #1428 (Global buffer overflow in slice_header): The slice_type value
read from H.264 exp-golomb data was used to index slice_types[] array
without bounds checking. Valid values are 0-9 per H.264 spec Table 7-6.
Now validates slice_type < 10 before use.
- #1427 (Heap buffer overflow in parse_PMT): ES_info_length from PMT
descriptor data was trusted without validation against buffer bounds.
Malformed PMT with excessive ES_info_length could read past buffer end.
Now validates ES_info_length and descriptor lengths against buffer.
Both issues were discovered using AddressSanitizer with crafted TS files.
Fixes #1427
Fixes #1428
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <[email protected]>1 parent 6fdfde0 commit 9fddaab
2 files changed
+47
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
954 | 954 | | |
955 | 955 | | |
956 | 956 | | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
957 | 966 | | |
958 | 967 | | |
959 | 968 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
257 | | - | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
258 | 260 | | |
259 | 261 | | |
260 | 262 | | |
| |||
275 | 277 | | |
276 | 278 | | |
277 | 279 | | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
278 | 287 | | |
279 | | - | |
| 288 | + | |
| 289 | + | |
280 | 290 | | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
281 | 295 | | |
282 | 296 | | |
283 | 297 | | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
284 | 302 | | |
285 | 303 | | |
286 | 304 | | |
| |||
324 | 342 | | |
325 | 343 | | |
326 | 344 | | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
327 | 352 | | |
328 | | - | |
| 353 | + | |
| 354 | + | |
329 | 355 | | |
330 | 356 | | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
331 | 361 | | |
332 | 362 | | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
333 | 368 | | |
334 | 369 | | |
335 | 370 | | |
| |||
0 commit comments