diff options
author | Avi Halachmi (:avih) <avihpit@yahoo.com> | 2020-11-29 14:03:32 +0200 |
---|---|---|
committer | Avi Halachmi (:avih) <avihpit@yahoo.com> | 2020-11-29 14:15:51 +0200 |
commit | 824e569fb56b2f4fbe9296cca2d319a0e33a4e19 (patch) | |
tree | 623116e6fc316f0af757ed2020c0c7d52d99aadb /video | |
parent | d4233021c72954be195310135ca2bcca898b8e54 (diff) | |
download | mpv-824e569fb56b2f4fbe9296cca2d319a0e33a4e19.tar.bz2 mpv-824e569fb56b2f4fbe9296cca2d319a0e33a4e19.tar.xz |
vo_tct: don't leak the frame reference
The reference is allocated at reconfig (and leaked at least once), but
could theoretically be called more than once by mpv, or in the future
when the tct code is enhanced to hande e.g. pan-and-scan changes.
Diffstat (limited to 'video')
-rw-r--r-- | video/out/vo_tct.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/video/out/vo_tct.c b/video/out/vo_tct.c index bb7a84f8cb..9325d3cbfa 100644 --- a/video/out/vo_tct.c +++ b/video/out/vo_tct.c @@ -209,6 +209,8 @@ static int reconfig(struct vo *vo, struct mp_image_params *params) }; const int mul = (p->opts->algo == ALGO_PLAIN ? 1 : 2); + if (p->frame) + talloc_free(p->frame); p->frame = mp_image_alloc(IMGFMT, p->swidth, p->sheight * mul); if (!p->frame) return -1; @@ -253,6 +255,9 @@ static void uninit(struct vo *vo) printf(ESC_RESTORE_CURSOR); printf(ESC_CLEAR_SCREEN); printf(ESC_GOTOXY, 0, 0); + struct priv *p = vo->priv; + if (p->frame) + talloc_free(p->frame); } static int preinit(struct vo *vo) |