Commit ae413a48 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/movtextdec: check that ftab has been allocated before dereferencing it

Fixes potential null pointer dereference on deallocation
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 2e7a684e
......@@ -93,9 +93,11 @@ static void mov_text_cleanup(MovTextContext *m)
static void mov_text_cleanup_ftab(MovTextContext *m)
{
int i;
for(i = 0; i < m->count_f; i++) {
av_freep(&m->ftab[i]->font);
av_freep(&m->ftab[i]);
if (m->ftab) {
for(i = 0; i < m->count_f; i++) {
av_freep(&m->ftab[i]->font);
av_freep(&m->ftab[i]);
}
}
av_freep(&m->ftab);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment