[FFmpeg-cvslog] avcodec/movtextdec: check that ftab has been allocated before dereferencing it
Michael Niedermayer
git at videolan.org
Thu Aug 6 23:55:02 CEST 2015
ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Thu Aug 6 22:40:01 2015 +0200| [ae413a48e64274b9740c3b27398fea92108a0f0e] | committer: Michael Niedermayer
avcodec/movtextdec: check that ftab has been allocated before dereferencing it
Fixes potential null pointer dereference on deallocation
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ae413a48e64274b9740c3b27398fea92108a0f0e
---
libavcodec/movtextdec.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/libavcodec/movtextdec.c b/libavcodec/movtextdec.c
index 15dd434..83b0231 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);
}
More information about the ffmpeg-cvslog
mailing list