diff options
author | Anton Khirnov <anton@khirnov.net> | 2013-01-30 07:00:50 +0100 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2013-02-07 07:18:56 +0100 |
commit | 7e35c50b81d97b513f6c4c719f2d476a681bd6d7 (patch) | |
tree | dbc72a774eb6e6e2df28bb5d4f4173d5cb34c87a | |
parent | 00bf66785f7d10c37c1677058caec218a7c8fc08 (diff) | |
download | ffmpeg-7e35c50b81d97b513f6c4c719f2d476a681bd6d7.tar.gz |
yop: check that extradata is large enough.
CC:libav-stable@libav.org
(cherry picked from commit 06cf597c352519d2b70f293518c61b8c312f5d4f)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
-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 0b9cdfebe2..939b81cb01 100644 --- a/libavcodec/yop.c +++ b/libavcodec/yop.c @@ -89,6 +89,11 @@ static av_cold int yop_decode_init(AVCodecContext *avctx) return -1; } + if (avctx->extradata_size < 3) { + av_log(avctx, AV_LOG_ERROR, "Missing or incomplete extradata.\n"); + return AVERROR_INVALIDDATA; + } + avctx->pix_fmt = AV_PIX_FMT_PAL8; s->num_pal_colors = avctx->extradata[0]; |