[FFmpeg-devel] [PATCH] astdec: fix division by zero

Michael Niedermayer michael at niedermayer.cc
Mon Oct 17 06:45:49 EEST 2016


On Sun, Oct 16, 2016 at 10:41:32PM +0200, Andreas Cadhalpun wrote:
> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
> ---
>  libavformat/astdec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/astdec.c b/libavformat/astdec.c
> index f3ca721..7a53d0b 100644
> --- a/libavformat/astdec.c
> +++ b/libavformat/astdec.c
> @@ -90,7 +90,7 @@ static int ast_read_packet(AVFormatContext *s, AVPacket *pkt)
>      pos  = avio_tell(s->pb);
>      type = avio_rl32(s->pb);
>      size = avio_rb32(s->pb);
> -    if (size > INT_MAX / s->streams[0]->codecpar->channels)
> +    if (!s->streams[0]->codecpar->channels || size > INT_MAX / s->streams[0]->codecpar->channels)

channels seems already checked in ast_read_header()

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

No great genius has ever existed without some touch of madness. -- Aristotle
-------------- 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/20161017/01b6bc6b/attachment.sig>


More information about the ffmpeg-devel mailing list