]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/bintext.c
avformat: Remove deprecated av_demuxer_open()
[ffmpeg] / libavcodec / bintext.c
index d85f2c2dd443504d8d51f32ec36e59b5f622c4a0..1aeed21f516746e7dc1aed76d21a31f25faecf04 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;
@@ -93,8 +97,10 @@ static av_cold int decode_init(AVCodecContext *avctx)
             break;
         }
     }
-    if (avctx->width < FONT_WIDTH || avctx->height < s->font_height)
+    if (avctx->width < FONT_WIDTH || avctx->height < s->font_height) {
+        av_log(avctx, AV_LOG_ERROR, "Resolution too small for font.\n");
         return AVERROR_INVALIDDATA;
+    }
 
     return 0;
 }