Browse code

Merge commit 'f401792595dd7760f531e8a3bd2336e9033bd45a'

* commit 'f401792595dd7760f531e8a3bd2336e9033bd45a':
vf_drawtext: Do not leak the mmapped textfile

Conflicts:
libavfilter/vf_drawtext.c

See: 6956b048d8198dce5126c8942dece21cfb1a7978
Merged-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2014/10/19 04:31:08
Showing 1 changed files
... ...
@@ -477,7 +477,7 @@ static int load_textfile(AVFilterContext *ctx)
477 477
         return err;
478 478
     }
479 479
 
480
-    if (!(tmp = av_realloc(s->text, textbuf_size + 1))) {
480
+    if (textbuf_size > SIZE_MAX - 1 || !(tmp = av_realloc(s->text, textbuf_size + 1))) {
481 481
         av_file_unmap(textbuf, textbuf_size);
482 482
         return AVERROR(ENOMEM);
483 483
     }