summaryrefslogtreecommitdiff
path: root/libavfilter
diff options
context:
space:
mode:
authorClément Bœsch <ubitux@gmail.com>2013-02-17 13:33:52 +0100
committerClément Bœsch <ubitux@gmail.com>2013-02-17 13:35:35 +0100
commitf3147917bf0067356776839152fcf7d85c88b8a9 (patch)
tree304b669e2971c0c64bdfdf88166f79f638d2cf87 /libavfilter
parentfe150a48a72efd633421adb3cfc9bfe26fa1591b (diff)
lavf/subtitles: error out in case of bitmap subtitles.
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/vf_subtitles.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavfilter/vf_subtitles.c b/libavfilter/vf_subtitles.c
index 8d582219f1..4f4fbf7311 100644
--- a/libavfilter/vf_subtitles.c
+++ b/libavfilter/vf_subtitles.c
@@ -267,6 +267,7 @@ static av_cold int init_subtitles(AVFilterContext *ctx, const char *args)
AVFormatContext *fmt = NULL;
AVCodecContext *dec_ctx = NULL;
AVCodec *dec = NULL;
+ AVCodecDescriptor *dec_desc;
AVStream *st;
AVPacket pkt;
AssContext *ass = ctx->priv;
@@ -309,6 +310,12 @@ static av_cold int init_subtitles(AVFilterContext *ctx, const char *args)
avcodec_get_name(dec_ctx->codec_id));
return AVERROR(EINVAL);
}
+ dec_desc = avcodec_descriptor_get(dec_ctx->codec_id);
+ if (dec_desc && (dec_desc->props & AV_CODEC_PROP_BITMAP_SUB)) {
+ av_log(ctx, AV_LOG_ERROR,
+ "Only text based subtitles are currently supported\n");
+ return AVERROR_PATCHWELCOME;
+ }
if (ass->charenc)
av_dict_set(&codec_opts, "sub_charenc", ass->charenc, 0);
ret = avcodec_open2(dec_ctx, dec, &codec_opts);