diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-04-12 20:17:08 +0300 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-04-13 01:36:39 +0300 |
commit | 300dd79c3d764a5d38b914bb0f36ba195422068e (patch) | |
tree | 0b07a79eea3bcf21cbcab7af92084ffefa46ffb1 /libavcodec/vbnenc.c | |
parent | 81b6a10937fd032add0bb51cffd3aabe4d7c9edb (diff) |
avcodec/vbn(dec|enc): Avoid leaving stale pointers in context
Therefore move the (Get|Put)ByteContext from the context to the stack.
It is transient anyway.
Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/vbnenc.c')
-rw-r--r-- | libavcodec/vbnenc.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/libavcodec/vbnenc.c b/libavcodec/vbnenc.c index 0b2c4dced2..03d36ccc86 100644 --- a/libavcodec/vbnenc.c +++ b/libavcodec/vbnenc.c @@ -37,7 +37,6 @@ typedef struct VBNContext { AVClass *class; TextureDSPContext dxtc; - PutByteContext pb; int format; TextureDSPThreadContext enc; } VBNContext; @@ -46,7 +45,7 @@ static int vbn_encode(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet) { VBNContext *ctx = avctx->priv_data; - PutByteContext *pb = &ctx->pb; + PutByteContext pb0, *const pb = &pb0; int ret; ptrdiff_t linesize; int64_t pkt_size; |