mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avcodec/movtextdec: Free ftab_temp
Fixes memleak Fixes: efe937780e95574250dabe07151bdc23/unknown_unknown_351_849_cov_3187578556_shellymanne.mov Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
a1a32fdb0e
commit
a047ccbb9f
@ -121,6 +121,9 @@ static void mov_text_cleanup(MovTextContext *m)
|
||||
static void mov_text_cleanup_ftab(MovTextContext *m)
|
||||
{
|
||||
int i;
|
||||
if (m->ftab_temp)
|
||||
av_freep(&m->ftab_temp->font);
|
||||
av_freep(&m->ftab_temp);
|
||||
if (m->ftab) {
|
||||
for(i = 0; i < m->count_f; i++) {
|
||||
av_freep(&m->ftab[i]->font);
|
||||
@ -210,7 +213,7 @@ static int mov_text_tx3g(AVCodecContext *avctx, MovTextContext *m)
|
||||
m->ftab_entries = 0;
|
||||
return -1;
|
||||
}
|
||||
m->ftab_temp = av_malloc(sizeof(*m->ftab_temp));
|
||||
m->ftab_temp = av_mallocz(sizeof(*m->ftab_temp));
|
||||
if (!m->ftab_temp) {
|
||||
mov_text_cleanup_ftab(m);
|
||||
return AVERROR(ENOMEM);
|
||||
@ -237,6 +240,7 @@ static int mov_text_tx3g(AVCodecContext *avctx, MovTextContext *m)
|
||||
mov_text_cleanup_ftab(m);
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
m->ftab_temp = NULL;
|
||||
tx3g_ptr = tx3g_ptr + font_length;
|
||||
}
|
||||
for (i = 0; i < m->ftab_entries; i++) {
|
||||
|
Loading…
Reference in New Issue
Block a user