lavc: Check the image size before calling get_buffer
Bug-Id: CVE-2011-3935 Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
This commit is contained in:
@@ -465,6 +465,8 @@ int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame)
|
|||||||
{
|
{
|
||||||
switch (avctx->codec_type) {
|
switch (avctx->codec_type) {
|
||||||
case AVMEDIA_TYPE_VIDEO:
|
case AVMEDIA_TYPE_VIDEO:
|
||||||
|
if (av_image_check_size(avctx->width, avctx->height, 0, avctx))
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
frame->width = avctx->width;
|
frame->width = avctx->width;
|
||||||
frame->height = avctx->height;
|
frame->height = avctx->height;
|
||||||
frame->format = avctx->pix_fmt;
|
frame->format = avctx->pix_fmt;
|
||||||
|
Reference in New Issue
Block a user