]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/bintext.c
avcodec: Constify AVCodecs
[ffmpeg] / libavcodec / bintext.c
index 49b75c9e271ea8140d3f27fea763e248aa54c8b6..520d68a7c072c3e2c8e469a81343d55578df332e 100644 (file)
@@ -63,6 +63,10 @@ static av_cold int decode_init(AVCodecContext *avctx)
             av_log(avctx, AV_LOG_ERROR, "not enough extradata\n");
             return AVERROR_INVALIDDATA;
         }
+        if (!s->font_height) {
+            av_log(avctx, AV_LOG_ERROR, "invalid font height\n");
+            return AVERROR_INVALIDDATA;
+        }
     } else {
         s->font_height = 8;
         s->flags = 0;
@@ -211,7 +215,7 @@ static int decode_frame(AVCodecContext *avctx,
 }
 
 #if CONFIG_BINTEXT_DECODER
-AVCodec ff_bintext_decoder = {
+const AVCodec ff_bintext_decoder = {
     .name           = "bintext",
     .long_name      = NULL_IF_CONFIG_SMALL("Binary text"),
     .type           = AVMEDIA_TYPE_VIDEO,
@@ -223,7 +227,7 @@ AVCodec ff_bintext_decoder = {
 };
 #endif
 #if CONFIG_XBIN_DECODER
-AVCodec ff_xbin_decoder = {
+const AVCodec ff_xbin_decoder = {
     .name           = "xbin",
     .long_name      = NULL_IF_CONFIG_SMALL("eXtended BINary text"),
     .type           = AVMEDIA_TYPE_VIDEO,
@@ -235,7 +239,7 @@ AVCodec ff_xbin_decoder = {
 };
 #endif
 #if CONFIG_IDF_DECODER
-AVCodec ff_idf_decoder = {
+const AVCodec ff_idf_decoder = {
     .name           = "idf",
     .long_name      = NULL_IF_CONFIG_SMALL("iCEDraw text"),
     .type           = AVMEDIA_TYPE_VIDEO,