diff mbox series

[FFmpeg-devel,03/36] avcodec/vp9_superframe_bsf: Flush bsf upon superframe creation error

Message ID 20200530160541.29517-3-andreas.rheinhardt@gmail.com
State New
Headers show
Series [FFmpeg-devel,01/36] avcodec/vp9_superframe_bsf: Check for existence of data before reading it
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Andreas Rheinhardt May 30, 2020, 4:05 p.m. UTC
Otherwise we might come into a situation where we have to reject future
packets because the cache is already full.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavcodec/vp9_superframe_bsf.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/vp9_superframe_bsf.c b/libavcodec/vp9_superframe_bsf.c
index d9c78c67f5..f330970acc 100644
--- a/libavcodec/vp9_superframe_bsf.c
+++ b/libavcodec/vp9_superframe_bsf.c
@@ -169,12 +169,10 @@  static int vp9_superframe_filter(AVBSFContext *ctx, AVPacket *pkt)
     av_assert0(s->n_cache > 0);
 
     // build superframe
-    if ((res = merge_superframe(s->cache, s->n_cache, pkt)) < 0)
-        goto done;
+    res = merge_superframe(s->cache, s->n_cache, pkt);
 
-    res = av_packet_copy_props(pkt, s->cache[s->n_cache - 1]);
-    if (res < 0)
-        goto done;
+    if (res >= 0)
+        res = av_packet_copy_props(pkt, s->cache[s->n_cache - 1]);
 
     vp9_superframe_flush(ctx);