Gif decoder: avoid undefined values in enum

The gif standard allocates 3 bits for the disposal method, but values
4-7 are unused.

Change-Id: I0f70b3f87b4cd8e98140c3da476702a22ebe93a9
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
(cherry picked from commit 30571068b203a9d950030b31ee84f08f2f6fc04d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Eirik Aavitsland 2020-05-29 11:09:22 +02:00 committed by Qt Cherry-pick Bot
parent 3315a400fc
commit e1e032d083

View File

@ -629,7 +629,8 @@ int QGIFFormat::decode(QImage *image, const uchar *buffer, int length,
count++;
if (count==hold[0]+1) {
disposePrevious(image);
disposal=Disposal((hold[1]>>2)&0x7);
uint dBits = (hold[1] >> 2) & 0x7;
disposal = (dBits <= RestoreImage) ? Disposal(dBits) : NoDisposal;
//UNUSED: waitforuser=!!((hold[1]>>1)&0x1);
int delay=count>3 ? LM(hold[2], hold[3]) : 1;
// IE and mozilla use a minimum delay of 10. With the minimum delay of 10