avcodec/libaomdec: use intermediate arrays for plane pointers and strides

Fixes -Wstringop-overflow warnings with libaom >= 2.0.0, where the unused alpha
plane was removed from aom_image.

Reviewed-by: James Zern <jzern@google.com>
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2021-10-30 10:56:26 -03:00
parent d92fdc7144
commit 28fac45bde
1 changed files with 7 additions and 3 deletions

View File

@ -224,9 +224,13 @@ static int aom_decode(AVCodecContext *avctx, void *data, int *got_frame,
if ((img->fmt & AOM_IMG_FMT_HIGHBITDEPTH) && img->bit_depth == 8) if ((img->fmt & AOM_IMG_FMT_HIGHBITDEPTH) && img->bit_depth == 8)
image_copy_16_to_8(picture, img); image_copy_16_to_8(picture, img);
else else {
av_image_copy(picture->data, picture->linesize, (const uint8_t **)img->planes, const uint8_t *planes[4] = { img->planes[0], img->planes[1], img->planes[2] };
img->stride, avctx->pix_fmt, img->d_w, img->d_h); const int stride[4] = { img->stride[0], img->stride[1], img->stride[2] };
av_image_copy(picture->data, picture->linesize, planes,
stride, avctx->pix_fmt, img->d_w, img->d_h);
}
*got_frame = 1; *got_frame = 1;
} }
return avpkt->size; return avpkt->size;