[FFmpeg-devel] [PATCH] huffyuvdec: validate image size

Michael Niedermayer michaelni at gmx.at
Sat Jun 27 22:40:07 CEST 2015


On Sat, Jun 27, 2015 at 07:42:48PM +0200, Andreas Cadhalpun wrote:
> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
> ---
>  libavcodec/huffyuvdec.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/libavcodec/huffyuvdec.c b/libavcodec/huffyuvdec.c
> index 98c6128..71fb9e3 100644
> --- a/libavcodec/huffyuvdec.c
> +++ b/libavcodec/huffyuvdec.c
> @@ -291,6 +291,12 @@ static av_cold int decode_init(AVCodecContext *avctx)
>      HYuvContext *s = avctx->priv_data;
>      int ret;
>  
> +    if (avctx->width <= 0 || avctx->height <= 0) {

LGTM
alternatively av_image_check_size() could be used but this should
be equally fine

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

What does censorship reveal? It reveals fear. -- Julian Assange
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150627/ce429430/attachment.asc>


More information about the ffmpeg-devel mailing list