1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-24 13:56:33 +02:00

avcodec/libvpxenc: Cleanup on error

This or fifo needs to be freed on errors explicitly

Fixes: memleak
Fixes: 68937/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LIBVPX_VP8_fuzzer-4830831016214528

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: James Zern <jzern@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2b2ced61eba03a1afc83e37614c6635ee9f2b551)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2024-06-17 01:08:28 +02:00
parent 8abfa9e42f
commit 13067aa562
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64

View File

@ -2040,6 +2040,7 @@ const FFCodec ff_libvpx_vp8_encoder = {
FF_CODEC_ENCODE_CB(vpx_encode),
.close = vpx_free,
.caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE |
FF_CODEC_CAP_INIT_CLEANUP |
FF_CODEC_CAP_AUTO_THREADS,
.p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_NONE },
.p.priv_class = &class_vp8,
@ -2116,6 +2117,7 @@ FFCodec ff_libvpx_vp9_encoder = {
FF_CODEC_ENCODE_CB(vpx_encode),
.close = vpx_free,
.caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE |
FF_CODEC_CAP_INIT_CLEANUP |
FF_CODEC_CAP_AUTO_THREADS,
.defaults = defaults,
.init_static_data = vp9_init_static,