qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/8] vnc-enc-tight: Fix divide-by-zero in tight_


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 1/8] vnc-enc-tight: Fix divide-by-zero in tight_detect_smooth_image{16, 24, 32}
Date: Wed, 28 May 2014 14:27:55 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

Il 28/05/2014 14:21, Gonglei (Arei) ha scritto:
-----Original Message-----
From: Paolo Bonzini [mailto:address@hidden On Behalf Of Paolo
Bonzini
Sent: Tuesday, May 27, 2014 9:34 PM
To: Gonglei (Arei); address@hidden
Cc: address@hidden; address@hidden; Huangweidong (C);
address@hidden; address@hidden; Luonengjun; address@hidden;
address@hidden; address@hidden; address@hidden;
address@hidden; address@hidden; address@hidden;
address@hidden; address@hidden
Subject: Re: [PATCH 1/8] vnc-enc-tight: Fix divide-by-zero in
tight_detect_smooth_image{16, 24, 32}

Il 27/05/2014 03:39, address@hidden ha scritto:
(1) Event assignment:  Assigning: "pixels" = "0".
(2) Event cond_true:  Condition "y < h", taking true branch
(3) Event cond_false:  Condition "x < w", taking false branch
(4) Event loop_end:  Reached end of loop
(5) Event divide_by_zero:  In expression "(stats[0] + stats[1]) * 100U /
pixels",
division by expression "pixels" which may be zero has undefined behavior.

I'm quite sure that this cannot happen (h and w must be > 0) but it
doesn't hurt.

Sorry for my poor English, do you agree with accept the patch or not, Paolo?

Yes, please include it in v2.

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]