Another inter frame may be waiting on this frame.
We must finish it to avoid infinite waiting.
---
 libavcodec/vvc/dec.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/libavcodec/vvc/dec.c b/libavcodec/vvc/dec.c
index 6aeec27eaf..92999a3ce3 100644
--- a/libavcodec/vvc/dec.c
+++ b/libavcodec/vvc/dec.c
@@ -854,6 +854,13 @@ static int decode_nal_units(VVCContext *s, VVCFrameContext 
*fc, AVPacket *avpkt)
             }
         }
     }
+
+    if (!fc->ft) {
+        av_log(s->avctx, AV_LOG_ERROR, "No frame in the packet.\n");
+        ret = AVERROR_INVALIDDATA;
+        goto fail;
+    }
+
     return 0;
 
 fail:
@@ -948,9 +955,6 @@ static int vvc_decode_frame(AVCodecContext *avctx, AVFrame 
*output,
     if (ret < 0)
         return ret;
 
-    if (!fc->ft)
-        return avpkt->size;
-
     ret = submit_frame(s, fc, output, got_output);
     if (ret < 0)
         return ret;
-- 
2.34.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to