John McCutchan 718ac2c814 Fix a crash in the new SurfaceProducer external texture (flutter/engine#49496)
The following sequence of events would lead to a crash:

- Reader A is created.
- Reader A produces a frame (A0)
- Texture is resized.
- Reader B is created and reader A is scheduled to be closed.
- Reader A produces a frame (A1). This is skipped.
- Reader A is closed.
- Frame A0 is acquired.

Because we closed Reader A the frame A0 is invalid.

The fix is to not close Reader A when it is the last reader to produce a
frame.

Fixes internal bug b/318458306
2024-01-03 10:56:46 -08:00
..