diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2015-08-06 22:40:01 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-08-06 23:38:55 +0200 |
commit | ae413a48e64274b9740c3b27398fea92108a0f0e (patch) | |
tree | b01d576c5ec61f7cd35ae1882ac398a636b0b8e0 /libavcodec | |
parent | 2e7a684e7214a9245532472f5d13e71f4f0de30f (diff) | |
download | ffmpeg-ae413a48e64274b9740c3b27398fea92108a0f0e.tar.gz |
avcodec/movtextdec: check that ftab has been allocated before dereferencing it
Fixes potential null pointer dereference on deallocation
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/movtextdec.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libavcodec/movtextdec.c b/libavcodec/movtextdec.c index 15dd43490a..83b0231f10 100644 --- a/libavcodec/movtextdec.c +++ b/libavcodec/movtextdec.c @@ -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); } |