]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/vp9_superframe_bsf: cache packets by creating new references rather than...
authorJames Almer <jamrial@gmail.com>
Tue, 31 Oct 2017 23:29:53 +0000 (20:29 -0300)
committerJames Almer <jamrial@gmail.com>
Tue, 31 Oct 2017 23:33:32 +0000 (20:33 -0300)
Should hopefully fix the invalid reads after free introduced in
e1bc3f4396ade6033787717d3650fb62663eae8 for all targets.

Signed-off-by: James Almer <jamrial@gmail.com>
libavcodec/vp9_superframe_bsf.c

index dea2cc232f9793afa0ff7736231796d8a75858b8..ceead5559cb848c72ffe675ce31edc60d7c0460d 100644 (file)
@@ -147,7 +147,9 @@ static int vp9_superframe_filter(AVBSFContext *ctx, AVPacket *out)
         goto done;
     }
 
-    av_packet_move_ref(s->cache[s->n_cache++], in);
+    res = av_packet_ref(s->cache[s->n_cache++], in);
+    if (res < 0)
+        goto done;
 
     if (invisible) {
         res = AVERROR(EAGAIN);