aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/yop.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-06-01 15:51:50 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-06-07 00:55:25 +0200
commitbb5314daba6572dee5e3fefa602de9b5b0df40d1 (patch)
treede083b937604a0ef611ffaedfe111b87683f0667 /libavcodec/yop.c
parent33a3f1fe9db206e1e01dd86f4a4f0c723a2e6080 (diff)
downloadffmpeg-bb5314daba6572dee5e3fefa602de9b5b0df40d1.tar.gz
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>
Diffstat (limited to 'libavcodec/yop.c')
-rw-r--r--libavcodec/yop.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/yop.c b/libavcodec/yop.c
index ac17297915..df61426dfe 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");