Commit 6d772fb
committed
comskip: fix SIGSEGV when lowres=1 on x86_64 MPEG-2 content
codecCtx->lowres was being set after avcodec_open2, but ff_idctdsp_init
runs during avcodec_open2 and — seeing lowres=0 — installs the full 8x8
AVX IDCT (ff_simple_idct8_put_avx). With lowres=1 set post-open, frame
buffers are half-sized while the IDCT still writes 8 rows, causing an
out-of-bounds write and intermittent SIGSEGV.
Fix: set codecCtx->lowres before avcodec_open2 so ff_idctdsp_init
correctly selects the 4x4 IDCT (ff_jref_idct4_put) for lowres=1.1 parent 0374038 commit 6d772fb
1 file changed
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1837 | 1837 | | |
1838 | 1838 | | |
1839 | 1839 | | |
| 1840 | + | |
| 1841 | + | |
| 1842 | + | |
| 1843 | + | |
| 1844 | + | |
| 1845 | + | |
1840 | 1846 | | |
1841 | 1847 | | |
1842 | 1848 | | |
| |||
1887 | 1893 | | |
1888 | 1894 | | |
1889 | 1895 | | |
1890 | | - | |
| 1896 | + | |
1891 | 1897 | | |
1892 | 1898 | | |
1893 | 1899 | | |
| |||
0 commit comments