diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c
index 5b0ade4f06ae42109a337e68034a53167289d9ed..805158eb049d7b5e0b193ffe43efaff6947957c2 100644
--- a/libavcodec/ffv1enc.c
+++ b/libavcodec/ffv1enc.c
@@ -793,6 +793,8 @@ static av_cold int encode_init(AVCodecContext *avctx)
         av_log(avctx, AV_LOG_ERROR, "format not supported\n");
         return AVERROR(ENOSYS);
     }
+    av_assert0(s->bits_per_raw_sample >= 8);
+
     if (s->transparency) {
         av_log(avctx, AV_LOG_WARNING, "Storing alpha plane, this will require a recent FFV1 decoder to playback!\n");
     }