summaryrefslogtreecommitdiff
path: root/libavcodec/vp9_superframe_bsf.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2017-10-31 20:29:53 -0300
committerJames Almer <jamrial@gmail.com>2017-10-31 20:33:32 -0300
commit7a02b364b68c0bf7f065f5c217fae458f0efdb8d (patch)
tree61ab5164a14580e97ad8ce9c31f7a24264dbf8ce /libavcodec/vp9_superframe_bsf.c
parent05d77587cb7d0a4e349c5320eb7c0b48610cf6bf (diff)
downloadffmpeg-7a02b364b68c0bf7f065f5c217fae458f0efdb8d.tar.gz
avcodec/vp9_superframe_bsf: cache packets by creating new references rather than moving them
Should hopefully fix the invalid reads after free introduced in e1bc3f4396ade6033787717d3650fb62663eae8 for all targets. Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/vp9_superframe_bsf.c')
-rw-r--r--libavcodec/vp9_superframe_bsf.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/vp9_superframe_bsf.c b/libavcodec/vp9_superframe_bsf.c
index dea2cc232f..ceead5559c 100644
--- a/libavcodec/vp9_superframe_bsf.c
+++ b/libavcodec/vp9_superframe_bsf.c
@@ -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);