OSDN Git Service
(root)
/
android-x86
/
external-ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0f64b6c
)
avcodec/rawdec: Check side data size before use
author
Michael Niedermayer
<michael@niedermayer.cc>
Sun, 30 Oct 2016 14:12:12 +0000
(15:12 +0100)
committer
Michael Niedermayer
<michael@niedermayer.cc>
Mon, 31 Oct 2016 00:19:16 +0000
(
01:19
+0100)
Fixes out of array read
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/rawdec.c
patch
|
blob
|
history
diff --git
a/libavcodec/rawdec.c
b/libavcodec/rawdec.c
index
1259577
..
45cf27f
100644
(file)
--- a/
libavcodec/rawdec.c
+++ b/
libavcodec/rawdec.c
@@
-364,9
+364,16
@@
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
);
int ret;
+
+ if (pal_size != AVPALETTE_SIZE) {
+ av_log(avctx, AV_LOG_ERROR, "Palette size %d is wrong\n", pal_size);
+ pal = NULL;
+ }
+
if (!context->palette)
context->palette = av_buffer_alloc(AVPALETTE_SIZE);
if (!context->palette) {