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

Michael Niedermayer michael at niedermayer.cc
Mon Oct 17 06:43:30 EEST 2016


On Sun, Oct 16, 2016 at 10:38:42PM +0200, Andreas Cadhalpun wrote:
> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
> ---
>  libavformat/aiffdec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c
> index cd916f9..de82787 100644
> --- a/libavformat/aiffdec.c
> +++ b/libavformat/aiffdec.c
> @@ -380,7 +380,7 @@ static int aiff_read_packet(AVFormatContext *s,
>          size = st->codecpar->block_align;
>          break;
>      default:
> -        size = (MAX_SIZE / st->codecpar->block_align) * st->codecpar->block_align;
> +        size = st->codecpar->block_align ? (MAX_SIZE / st->codecpar->block_align) * st->codecpar->block_align : MAX_SIZE;

how do you reach block_align == 0 ?
aiff_read_header() checks for block_align == 0

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Does the universe only have a finite lifespan? No, its going to go on
forever, its just that you wont like living in it. -- Hiranya Peiri
-------------- 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/20f7985a/attachment.sig>


More information about the ffmpeg-devel mailing list