Browse code

lavf/subtitles: error out in case of bitmap subtitles.

Clément Bœsch authored on 2013/02/17 21:33:52
Showing 1 changed files
... ...
@@ -267,6 +267,7 @@ static av_cold int init_subtitles(AVFilterContext *ctx, const char *args)
267 267
     AVFormatContext *fmt = NULL;
268 268
     AVCodecContext *dec_ctx = NULL;
269 269
     AVCodec *dec = NULL;
270
+    AVCodecDescriptor *dec_desc;
270 271
     AVStream *st;
271 272
     AVPacket pkt;
272 273
     AssContext *ass = ctx->priv;
... ...
@@ -309,6 +310,12 @@ static av_cold int init_subtitles(AVFilterContext *ctx, const char *args)
309 309
                avcodec_get_name(dec_ctx->codec_id));
310 310
         return AVERROR(EINVAL);
311 311
     }
312
+    dec_desc = avcodec_descriptor_get(dec_ctx->codec_id);
313
+    if (dec_desc && (dec_desc->props & AV_CODEC_PROP_BITMAP_SUB)) {
314
+        av_log(ctx, AV_LOG_ERROR,
315
+               "Only text based subtitles are currently supported\n");
316
+        return AVERROR_PATCHWELCOME;
317
+    }
312 318
     if (ass->charenc)
313 319
         av_dict_set(&codec_opts, "sub_charenc", ass->charenc, 0);
314 320
     ret = avcodec_open2(dec_ctx, dec, &codec_opts);