mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-28 20:53:54 +02:00
avcodec/rawdec: Check side data size before use
Fixes out of array read
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 5f0bc0215a
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
147a387fba
commit
744f78ce0d
@ -271,8 +271,13 @@ static int raw_decode(AVCodecContext *avctx, void *data, int *got_frame,
|
||||
}
|
||||
|
||||
if (avctx->pix_fmt == AV_PIX_FMT_PAL8) {
|
||||
int pal_size;
|
||||
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE,
|
||||
NULL);
|
||||
&pal_size);
|
||||
if (pal_size != AVPALETTE_SIZE) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Palette size %d is wrong\n", pal_size);
|
||||
pal = NULL;
|
||||
}
|
||||
|
||||
if (pal) {
|
||||
av_buffer_unref(&context->palette);
|
||||
|
Loading…
Reference in New Issue
Block a user