mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-05-17 15:08:09 +08:00

Up until now if avcodec_send_packet() returned an error, no attempt to receive a frame from the decoder would be made. Instead the decoder was presumed to be drained, so that more packets could be sent to it. Yet this need not be so: It can happen that a packet would decode to multiple frames and that decoding the first of these (the one that is decoded during the avcodec_send_packet() call) returns an error, in which case the decoder is not yet ready to receive more input as the remaining parts of the packet have not been decoded yet. In this case, an AERROR_BUG is triggered. This happens in ticket #11553 with VP9 (which uses a BSF to split VP9 superframes and is therefore affected by this). Fix this by always calling avcodec_receive_frame() unless xerror is set. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>