mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2024-11-25 12:40:01 +00:00
iff/ilbm: check remaining buffer size.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
b8551f8ea7
commit
2fbb37b51b
@ -575,13 +575,13 @@ static int decode_frame_ilbm(AVCodecContext *avctx,
|
||||
}
|
||||
} else if (avctx->codec_tag == MKTAG('P','B','M',' ')) { // IFF-PBM
|
||||
if (avctx->pix_fmt == AV_PIX_FMT_PAL8 || avctx->pix_fmt == AV_PIX_FMT_GRAY8) {
|
||||
for(y = 0; y < avctx->height; y++ ) {
|
||||
for(y = 0; y < avctx->height && buf_end > buf; y++ ) {
|
||||
uint8_t *row = &s->frame.data[0][y * s->frame.linesize[0]];
|
||||
memcpy(row, buf, FFMIN(avctx->width, buf_end - buf));
|
||||
buf += avctx->width + (avctx->width % 2); // padding if odd
|
||||
}
|
||||
} else if (s->ham) { // IFF-PBM: HAM to AV_PIX_FMT_BGR32
|
||||
for (y = 0; y < avctx->height; y++) {
|
||||
for (y = 0; y < avctx->height && buf_end > buf; y++) {
|
||||
uint8_t *row = &s->frame.data[0][ y*s->frame.linesize[0] ];
|
||||
memcpy(s->ham_buf, buf, FFMIN(avctx->width, buf_end - buf));
|
||||
buf += avctx->width + (avctx->width & 1); // padding if odd
|
||||
|
Loading…
Reference in New Issue
Block a user