diff --git a/webrtc/test/fuzzers/pseudotcp_parser_fuzzer.cc b/webrtc/test/fuzzers/pseudotcp_parser_fuzzer.cc index f373e6cf9f..4e14a13eeb 100644 --- a/webrtc/test/fuzzers/pseudotcp_parser_fuzzer.cc +++ b/webrtc/test/fuzzers/pseudotcp_parser_fuzzer.cc @@ -11,6 +11,7 @@ #include #include +#include "webrtc/base/thread.h" #include "webrtc/p2p/base/pseudotcp.h" namespace webrtc { @@ -29,10 +30,15 @@ class FakeIPseudoTcpNotify : public cricket::IPseudoTcpNotify { }; struct Environment { - cricket::PseudoTcp* ptcp; - explicit Environment(cricket::IPseudoTcpNotify* notifier) { - ptcp = new cricket::PseudoTcp(notifier, 0); + explicit Environment(cricket::IPseudoTcpNotify* notifier): + ptcp(new cricket::PseudoTcp(notifier, 0)) { } + + cricket::PseudoTcp* const ptcp; + + // We need the thread to avoid some uninteresting crashes, since the + // production code expects there to be a thread object available. + rtc::AutoThread thread; }; Environment* env = new Environment(new FakeIPseudoTcpNotify());