diff --git a/libavcodec/wnv1.c b/libavcodec/wnv1.c index 0cf2181a48..6251c00187 100644 --- a/libavcodec/wnv1.c +++ b/libavcodec/wnv1.c @@ -125,6 +125,9 @@ static av_cold int decode_init(AVCodecContext *avctx) { static AVOnce init_static_once = AV_ONCE_INIT; + if (avctx->width <= 1) + return AVERROR_INVALIDDATA; + avctx->pix_fmt = AV_PIX_FMT_YUV422P; ff_thread_once(&init_static_once, wnv1_init_static);