[FFmpeg-devel] [PATCH 9/9] xvag: prevent overflow during block alignment calculation

Michael Niedermayer michael at niedermayer.cc
Sat Jan 7 03:52:17 EET 2017


On Fri, Jan 06, 2017 at 08:49:49PM +0100, Andreas Cadhalpun wrote:
> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
> ---
>  libavformat/xvag.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libavformat/xvag.c b/libavformat/xvag.c
> index 5ef4fb0900..1f28df7b89 100644
> --- a/libavformat/xvag.c
> +++ b/libavformat/xvag.c
> @@ -74,6 +74,7 @@ static int xvag_read_header(AVFormatContext *s)
>      switch (codec) {
>      case 0x1c:
>          st->codecpar->codec_id    = AV_CODEC_ID_ADPCM_PSX;
> +        FF_RETURN_ON_OVERFLOW(s, st->codecpar->channels > INT_MAX / 16)

this check could also be added to
"if (st->codecpar->channels <= 0)" above

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

I am the wisest man alive, for I know one thing, and that is that I know
nothing. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170107/f6516fee/attachment.sig>


More information about the ffmpeg-devel mailing list