aboutsummaryrefslogtreecommitdiff
path: root/libavformat/avidec.c
diff options
context:
space:
mode:
authorMichael Niedermayer2017-05-30 21:29:20 +0200
committerMichael Niedermayer2017-05-31 02:32:42 +0200
commita5d849b149ca67ced2d271dc84db0bc95a548abb (patch)
treed27aea15fb5f943d9acfe0ca8b4f0c02bb5ce86b /libavformat/avidec.c
parent78f6ec32a37215f21e1efb299e233f1c0e031a0b (diff)
avformat/avidec: Limit formats in gab2 to srt and ass/ssa
This prevents part of one exploit leading to an information leak Found-by: Emil Lerner and Pavel Cheremushkin Reported-by: Thierry Foucu <tfoucu@google.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/avidec.c')
-rw-r--r--libavformat/avidec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index b6ef0ac62d..df52092067 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -1099,6 +1099,9 @@ static int read_gab2_sub(AVFormatContext *s, AVStream *st, AVPacket *pkt)
if (!sub_demuxer)
goto error;
+ if (strcmp(sub_demuxer->name, "srt") && strcmp(sub_demuxer->name, "ass"))
+ goto error;
+
if (!(ast->sub_ctx = avformat_alloc_context()))
goto error;