[FFmpeg-cvslog] mss1: check number of free colours

Clément Bœsch ubitux at gmail.com
Tue Jun 26 07:45:55 CEST 2012


On Tue, Jun 26, 2012 at 01:07:46AM +0200, Paul B Mahol wrote:
> ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Mon Jun 25 22:45:08 2012 +0000| [e3c26705392e462fabf54366fbad3dbf6ec832d1] | committer: Paul B Mahol
> 
> mss1: check number of free colours
> 
> Prevents out of array write.
> 
> Signed-off-by: Paul B Mahol <onemda at gmail.com>
> 
> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e3c26705392e462fabf54366fbad3dbf6ec832d1
> ---
> 
>  libavcodec/mss1.c |    4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/libavcodec/mss1.c b/libavcodec/mss1.c
> index b9e3233..dfddbd9 100644
> --- a/libavcodec/mss1.c
> +++ b/libavcodec/mss1.c
> @@ -783,6 +783,10 @@ static av_cold int mss1_decode_init(AVCodecContext *avctx)
>      av_log(avctx, AV_LOG_DEBUG, "Encoder version %d.%d\n",
>             AV_RB32(avctx->extradata + 4), AV_RB32(avctx->extradata + 8));
>      c->free_colours     = AV_RB32(avctx->extradata + 48);
> +    if (c->free_colours < 0 || c->free_colours > 256) {

257 colours?

[...]

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-cvslog/attachments/20120626/9b96ab60/attachment.asc>


More information about the ffmpeg-cvslog mailing list