diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-06-01 17:51:50 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-06-09 22:47:11 +0400 |
commit | 3c69368e6be17f9c99767f0d3e0c078b0ea976e8 (patch) | |
tree | 19f43f33560c1ce5517c2caf32b095f1c6b2df16 | |
parent | fcf09ebff5af35280c655eaa40baed1c586fdf77 (diff) |
yopdec: check that palette fits in the packet
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b6fdf8dea7aaf3cb9a979dce91f752c2ce3086a3)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/yop.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/yop.c b/libavcodec/yop.c index 55526c2543..bf8a000e14 100644 --- a/libavcodec/yop.c +++ b/libavcodec/yop.c @@ -204,6 +204,11 @@ static int yop_decode_frame(AVCodecContext *avctx, void *data, int *data_size, if (s->frame.data[0]) avctx->release_buffer(avctx, &s->frame); + if (avpkt->size < 4 + 3*s->num_pal_colors) { + av_log(avctx, AV_LOG_ERROR, "packet of size %d too small\n", avpkt->size); + return AVERROR_INVALIDDATA; + } + ret = avctx->get_buffer(avctx, &s->frame); if (ret < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); |