Browse Source

jvdec: check frame dimensions

The frame size must be set by the caller and each dimension must be a
multiple of 8.

CC: libav-stable@libav.org
Bug-ID: CVE-2014-8542
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
tags/n2.6
Anton Khirnov 10 years ago
parent
commit
88626e5af8
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      libavcodec/jvdec.c

+ 7
- 0
libavcodec/jvdec.c View File

@@ -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);


Loading…
Cancel
Save