mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-27 13:10:37 +00:00
lagarith: always allocate for 4 planes. Fixes out of array accesses
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
87c113f4b3
commit
9eef41b848
@ -569,7 +569,7 @@ static int lag_decode_frame(AVCodecContext *avctx,
|
||||
|
||||
if (!l->rgb_planes) {
|
||||
l->rgb_stride = FFALIGN(avctx->width, 16);
|
||||
l->rgb_planes = av_malloc(l->rgb_stride * avctx->height * planes + 16);
|
||||
l->rgb_planes = av_malloc(l->rgb_stride * avctx->height * 4 + 16);
|
||||
if (!l->rgb_planes) {
|
||||
av_log(avctx, AV_LOG_ERROR, "cannot allocate temporary buffer\n");
|
||||
return AVERROR(ENOMEM);
|
||||
|
Loading…
Reference in New Issue
Block a user