[FFmpeg-devel] [PATCH 05/36] avcodec/vp9_superframe_bsf: Allow up to eight frames in a superframe

Andreas Rheinhardt andreas.rheinhardt at gmail.com
Sat May 30 19:05:10 EEST 2020


Up until now, the bsf errored out with a message that there were too
many invisible frames if there were already seven frames cached even
when the new frame was not invisible. This has been changed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
---
 libavcodec/vp9_superframe_bsf.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/vp9_superframe_bsf.c b/libavcodec/vp9_superframe_bsf.c
index a8b58a7fd3..a7faad3abf 100644
--- a/libavcodec/vp9_superframe_bsf.c
+++ b/libavcodec/vp9_superframe_bsf.c
@@ -158,13 +158,15 @@ static int vp9_superframe_filter(AVBSFContext *ctx, AVPacket *pkt)
     } else if ((!invisible || uses_superframe_syntax) && !s->n_cache) {
         // passthrough
         return 0;
-    } else if (s->n_cache + 1 >= MAX_CACHE) {
+    } else if (invisible && s->n_cache + 1 >= MAX_CACHE) {
         av_log(ctx, AV_LOG_ERROR,
                "Too many invisible frames\n");
         res = AVERROR_INVALIDDATA;
         goto done;
     }
 
+    av_assert0(s->n_cache < MAX_CACHE);
+
     av_packet_move_ref(s->cache[s->n_cache++], pkt);
 
     if (invisible) {
-- 
2.20.1



More information about the ffmpeg-devel mailing list