Merge commit 'f401792595dd7760f531e8a3bd2336e9033bd45a'
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 18 Oct 2014 19:31:08 +0000 (21:31 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 18 Oct 2014 19:33:04 +0000 (21:33 +0200)
* commit 'f401792595dd7760f531e8a3bd2336e9033bd45a':
  vf_drawtext: Do not leak the mmapped textfile

Conflicts:
libavfilter/vf_drawtext.c

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

index 4ab96dc46acd98a5fafff8ba31fa4a64af4fc3b0..cf570643552f5229b07d86144d751e02420ac7ed 100644 (file)
@@ -477,7 +477,7 @@ static int load_textfile(AVFilterContext *ctx)
         return err;
     }
 
-    if (!(tmp = av_realloc(s->text, textbuf_size + 1))) {
+    if (textbuf_size > SIZE_MAX - 1 || !(tmp = av_realloc(s->text, textbuf_size + 1))) {
         av_file_unmap(textbuf, textbuf_size);
         return AVERROR(ENOMEM);
     }