mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
xxan: Disallow odd width
Decoded data is always written in pairs within this decoder. This fixes writes out of bounds. Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
parent
fc739b3eef
commit
aa0dd52434
@ -50,6 +50,10 @@ static av_cold int xan_decode_init(AVCodecContext *avctx)
|
||||
av_log(avctx, AV_LOG_ERROR, "Invalid frame height: %d.\n", avctx->height);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
if (avctx->width & 1) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Invalid frame width: %d.\n", avctx->width);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
|
||||
s->buffer_size = avctx->width * avctx->height;
|
||||
s->y_buffer = av_malloc(s->buffer_size);
|
||||
|
Loading…
Reference in New Issue
Block a user