In a normal scenario, the JpegDecodeAcceleratorTest::TestDecode() method in media/gpu/jpeg_decode_accelerator_unittest.cc starts a new thread, creates a JpegClient, and then posts tasks to the new thread to have the JpegClient create a decoder, invoke its functionality, and destroy it.
However, if, e.g., an ASSERT_EQ fails, the JpegClient instance is destroyed in the main thread, causing its decoder_ member to be destroyed in the main thread as well. This is incorrect because [1] and [2] require that the destructors be called in the thread in which the objects were created.
[1] https://cs.chromium.org/chromium/src/media/gpu/vaapi/vaapi_jpeg_decode_accelerator.cc?l=126
[2] https://cs.chromium.org/chromium/src/media/gpu/v4l2/v4l2_jpeg_decode_accelerator.cc?dr=CSs&g=0&l=160
Comment 1 by bugdroid1@chromium.org
, Jun 8 2018