mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2025-02-10 06:14:01 +00:00
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>
This commit is contained in:
parent
0062869ae2
commit
e1c7892013
@ -254,7 +254,7 @@ static int update_size(AVCodecContext *ctx, int w, int h)
|
|||||||
s->rows = (h + 7) >> 3;
|
s->rows = (h + 7) >> 3;
|
||||||
|
|
||||||
#define assign(var, type, n) var = (type) p; p += s->sb_cols * n * sizeof(*var)
|
#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) +
|
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)));
|
64 * s->sb_rows * (1 + sizeof(*s->mv[0]) * 2)));
|
||||||
if (!p)
|
if (!p)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user