Movist has for a long time had a problem where seeking forward when the play position was very close to the end of the file could make the app crash. The reason turned out to be that in order to flush the FFmpeg decoder buffer queue, a special statically allocated marker packet was inserted into the queue. If the queue itself was dealloc:ed when this packet was in the queue, the marker packet would be passed to av_free_packet which would then trigger the OS malloc checks.
Also lock the mutex in [PacketQueue putPacket:], because it's used everywhere else.
Movist has for a long time had a problem where seeking forward when the play position was very close to the end of the file could make the app crash. The reason turned out to be that in order to flush the FFmpeg decoder buffer queue, a special statically allocated marker packet was inserted into the queue. If the queue itself was
dealloc:
ed when this packet was in the queue, the marker packet would be passed toav_free_packet
which would then trigger the OS malloc checks.Also lock the mutex in
[PacketQueue putPacket:]
, because it's used everywhere else.