aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/decode.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2023-07-10 01:26:31 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2023-07-10 16:25:46 +0200
commita92dbeb9ae520d39069381be528c5e8d4756da5f (patch)
tree55cea41b4d611d669f67ce18184a00420bb02233 /libavcodec/decode.c
parentf6dc85ae1610b6aae40fc3c8eb61791d71ea00ab (diff)
downloadffmpeg-a92dbeb9ae520d39069381be528c5e8d4756da5f.tar.gz
avcodec/decode: Return EAGAIN instead of discarding unused packet
Should fix #10457, a regression caused by 69516ab3e917a6e91d26e38d04183c60fd71cbab. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/decode.c')
-rw-r--r--libavcodec/decode.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index 269633ce10..a47abeca06 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -666,7 +666,9 @@ int attribute_align_arg avcodec_send_packet(AVCodecContext *avctx, const AVPacke
if (avpkt && !avpkt->size && avpkt->data)
return AVERROR(EINVAL);
- av_packet_unref(avci->buffer_pkt);
+ if (!AVPACKET_IS_EMPTY(avci->buffer_pkt))
+ return AVERROR(EAGAIN);
+
if (avpkt && (avpkt->data || avpkt->side_data_elems)) {
ret = av_packet_ref(avci->buffer_pkt, avpkt);
if (ret < 0)