mirror of https://git.ffmpeg.org/ffmpeg.git
avcodec/libvpxdec: Check that display dimensions fit in the storage dimensions
Fixes assertion failure Fixes: 2112/clusterfuzz-testcase-minimized-4526878557732864 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
07339a45a0
commit
f8593c2f49
|
@ -244,6 +244,13 @@ static int vpx_decode(AVCodecContext *avctx,
|
||||||
(img_alpha = vpx_codec_get_frame(&ctx->decoder_alpha, &iter_alpha)))) {
|
(img_alpha = vpx_codec_get_frame(&ctx->decoder_alpha, &iter_alpha)))) {
|
||||||
uint8_t *planes[4];
|
uint8_t *planes[4];
|
||||||
int linesizes[4];
|
int linesizes[4];
|
||||||
|
|
||||||
|
if (img->d_w > img->w || img->d_h > img->h) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "Display dimensions %dx%d exceed storage %dx%d\n",
|
||||||
|
img->d_w, img->d_h, img->w, img->h);
|
||||||
|
return AVERROR_EXTERNAL;
|
||||||
|
}
|
||||||
|
|
||||||
if ((ret = set_pix_fmt(avctx, img, ctx->has_alpha_channel)) < 0) {
|
if ((ret = set_pix_fmt(avctx, img, ctx->has_alpha_channel)) < 0) {
|
||||||
#ifdef VPX_IMG_FMT_HIGHBITDEPTH
|
#ifdef VPX_IMG_FMT_HIGHBITDEPTH
|
||||||
av_log(avctx, AV_LOG_ERROR, "Unsupported output colorspace (%d) / bit_depth (%d)\n",
|
av_log(avctx, AV_LOG_ERROR, "Unsupported output colorspace (%d) / bit_depth (%d)\n",
|
||||||
|
|
Loading…
Reference in New Issue