At EOF it makes no sense to modify avpkt.{data,size} in output_packet since no data is consumed. Frame threading with more than 1 threads hits the segfault.
Unified · Split
| @@ -1892,8 +1892,11 @@ static int output_packet(InputStream *ist, · 1891 unmodified lines | ||
| 1892 | 1892 | |
| 1893 | 1893 | if (ret < 0) |
| 1894 | 1894 | return ret; |
| 1895 | − avpkt.data += ret; | |
| 1896 | − avpkt.size -= ret; | |
| 1895 | + // touch data and size only if not EOF | |
| 1896 | + if (pkt) { | |
| 1897 | + avpkt.data += ret; | |
| 1898 | + avpkt.size -= ret; | |
| 1899 | + } | |
| 1897 | 1900 | if (!got_output) { |
| 1898 | 1901 | continue; |
| 1899 | 1902 | } |