aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/vp9.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2013-11-10 19:16:14 +0000
committerPaul B Mahol <onemda@gmail.com>2013-11-12 23:41:58 +0000
commite1c7892013d2832df85dfef6368bd64e82547418 (patch)
tree2c083dfdc06c74e020ea0cfad01e7281553b5e14 /libavcodec/vp9.c
parent0062869ae25007c8506517dcfcbe6f439dc6958a (diff)
downloadffmpeg-e1c7892013d2832df85dfef6368bd64e82547418.tar.gz
avcodec/vp9: use av_freep() for above_partition_ctx
Fixes use after free if memory allocation fails. Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavcodec/vp9.c')
-rw-r--r--libavcodec/vp9.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index d26f122b81..4f9c1ad1da 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -254,7 +254,7 @@ static int update_size(AVCodecContext *ctx, int w, int h)
s->rows = (h + 7) >> 3;
#define assign(var, type, n) var = (type) p; p += s->sb_cols * n * sizeof(*var)
- av_free(s->above_partition_ctx);
+ av_freep(&s->above_partition_ctx);
p = av_malloc(s->sb_cols * (240 + sizeof(*s->lflvl) + 16 * sizeof(*s->above_mv_ctx) +
64 * s->sb_rows * (1 + sizeof(*s->mv[0]) * 2)));
if (!p)