summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <[email protected]>2020-09-12 23:52:36 +0200
committerAndreas Rheinhardt <[email protected]>2021-02-27 07:20:57 +0100
commit0dd79193a773d867b624095d555ebf01c2529ebe (patch)
tree727b7bc2c3cbde87c9ffdf9b85a6901c75207246
parentce629ee2164ce316feb1ceb96868fa447d42ce88 (diff)
avcodec/qtrleenc: Fix memleak upon allocation failure
The qtrle encoder allocates several buffers and an AVFrame in its init function. If one of these allocations fails, but others succeed, the successfully allocated objects leak. This is fixed by setting the FF_CODEC_CAP_INIT_CLEANUP flag. Signed-off-by: Andreas Rheinhardt <[email protected]> (cherry picked from commit 2a71cbeb019fabd70f04ca9d2ec5d0bff3b3e3d2)
-rw-r--r--libavcodec/qtrleenc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/qtrleenc.c b/libavcodec/qtrleenc.c
index 6669c1302f..8b0edf7b3d 100644
--- a/libavcodec/qtrleenc.c
+++ b/libavcodec/qtrleenc.c
@@ -413,4 +413,5 @@ AVCodec ff_qtrle_encoder = {
.pix_fmts = (const enum AVPixelFormat[]){
AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB555BE, AV_PIX_FMT_ARGB, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE
},
+ .caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
};