diff --git a/libavcodec/dvdsubenc.c b/libavcodec/dvdsubenc.c
index c87f3369c4eba840777fd529b5a55d5c62a06ea6..d9137080264884219760bf907ecb38ad0daf19fa 100644
--- a/libavcodec/dvdsubenc.c
+++ b/libavcodec/dvdsubenc.c
@@ -256,6 +256,11 @@ static int encode_dvd_subtitles(AVCodecContext *avctx,
 
     if (rects == 0 || h->rects == NULL)
         return AVERROR(EINVAL);
+    for (i = 0; i < rects; i++)
+        if (h->rects[i]->type != SUBTITLE_BITMAP) {
+            av_log(avctx, AV_LOG_ERROR, "Bitmap subtitle required\n");
+            return AVERROR(EINVAL);
+        }
     vrect = *h->rects[0];
 
     if (rects > 1) {