summaryrefslogtreecommitdiff
path: root/libavcodec/sp5xdec.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-11-26 21:54:54 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-12-04 15:46:46 +0100
commitf3e645a7967d64df8a19c4e0eea93f17937913fb (patch)
treea6c9c73edb7f3f3d0a8db67bd7a2260ec13abd53 /libavcodec/sp5xdec.c
parent6a2defd7d8edc79115a2231de80d357e02e4a3ca (diff)
downloadffmpeg-f3e645a7967d64df8a19c4e0eea93f17937913fb.tar.gz
avcodec/mjpegdec: Fix memleak upon init failure
This affected all decoders that used ff_mjpeg_decode_init() as init function; and it also affected decoders that open jpeg decoders via ff_codec_open2_recursive() as well as MxPEG. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/sp5xdec.c')
-rw-r--r--libavcodec/sp5xdec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/sp5xdec.c b/libavcodec/sp5xdec.c
index 815f9ad50e..ad2e9b11a9 100644
--- a/libavcodec/sp5xdec.c
+++ b/libavcodec/sp5xdec.c
@@ -106,7 +106,7 @@ AVCodec ff_sp5x_decoder = {
.decode = sp5x_decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
.max_lowres = 3,
- .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
};
#endif
#if CONFIG_AMV_DECODER
@@ -121,6 +121,6 @@ AVCodec ff_amv_decoder = {
.decode = sp5x_decode_frame,
.max_lowres = 3,
.capabilities = AV_CODEC_CAP_DR1,
- .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
};
#endif