diff options
author | Marton Balint <cus@passwd.hu> | 2019-10-27 18:10:36 +0100 |
---|---|---|
committer | James Zern <jzern@google.com> | 2019-11-05 23:14:24 -0800 |
commit | c54268ce02f71c144d444a5e6d35417d5f043ed5 (patch) | |
tree | 76847f0eb97e9d7e818df917619c57f554d04bf1 /libavcodec | |
parent | 5478e2cc57d1fb73ab49f39c84b23f180bfa39e5 (diff) | |
download | ffmpeg-c54268ce02f71c144d444a5e6d35417d5f043ed5.tar.gz |
avcodec/libvpxdec: reject video and alpha dimension mismatches
Signed-off-by: Marton Balint <cus@passwd.hu>
Signed-off-by: James Zern <jzern@google.com>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/libvpxdec.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libavcodec/libvpxdec.c b/libavcodec/libvpxdec.c index fdd5d458d3..1ae2361167 100644 --- a/libavcodec/libvpxdec.c +++ b/libavcodec/libvpxdec.c @@ -283,6 +283,17 @@ static int vpx_decode(AVCodecContext *avctx, return ret; } + if (ctx->has_alpha_channel && + (img->d_w != img_alpha->d_w || + img->d_h != img_alpha->d_h || + img->bit_depth != img_alpha->bit_depth)) { + av_log(avctx, AV_LOG_ERROR, + "Video dimensions %dx%d@%dbpp differ from alpha dimensions %dx%d@%dbpp\n", + img->d_w, img->d_h, img->bit_depth, + img_alpha->d_w, img_alpha->d_h, img_alpha->bit_depth); + return AVERROR_INVALIDDATA; + } + planes[0] = img->planes[VPX_PLANE_Y]; planes[1] = img->planes[VPX_PLANE_U]; planes[2] = img->planes[VPX_PLANE_V]; |