diff options
Diffstat (limited to 'libavcodec/jvdec.c')
-rw-r--r-- | libavcodec/jvdec.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/jvdec.c b/libavcodec/jvdec.c index bb347e0..2a7aa10 100644 --- a/libavcodec/jvdec.c +++ b/libavcodec/jvdec.c @@ -43,6 +43,13 @@ static av_cold int decode_init(AVCodecContext *avctx) { JvContext *s = avctx->priv_data; + if (!avctx->width || !avctx->height || + (avctx->width & 7) || (avctx->height & 7)) { + av_log(avctx, AV_LOG_ERROR, "Invalid video dimensions: %dx%d\n", + avctx->width, avctx->height); + return AVERROR(EINVAL); + } + s->frame = av_frame_alloc(); if (!s->frame) return AVERROR(ENOMEM); |