avcodec/bintext: Add error message when resolution is too small for font.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Nikolas Bowe 2019-04-08 15:22:10 -07:00 committed by Michael Niedermayer
parent b91786360f
commit dd9907847c

View File

@ -93,8 +93,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;
}