diff --git a/libavformat/avidec.c b/libavformat/avidec.c index 4e694fe447..ed043470f0 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -1098,6 +1098,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;