]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/ansi.c
avcodec/nvenc: Extended rate-control support as provided by SDK 7
[ffmpeg] / libavcodec / ansi.c
index 4808ea7fff87a680ce0944efd020b40aea0b4f5d..19c88d8d516dcc8a0b0376beb6b3004524b0a99b 100644 (file)
@@ -94,6 +94,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
         int ret = ff_set_dimensions(avctx, 80 << 3, 25 << 4);
         if (ret < 0)
             return ret;
+    } else if (avctx->width % FONT_WIDTH || avctx->height % s->font_height) {
+        av_log(avctx, AV_LOG_ERROR, "Invalid dimensions %d %d\n", avctx->width, avctx->height);
+        return AVERROR(EINVAL);
     }
     return 0;
 }