Fixed out-of-bounds read in packJPG

- Should fix #99
This commit is contained in:
Christian Schneider 2019-05-16 07:58:30 +02:00
parent 90f2353425
commit a0401d7a26

View file

@ -3758,7 +3758,9 @@ INTERN bool jpg_parse_jfif( unsigned char type, unsigned int len, unsigned char*
cmpnfo[ cmp ].jid = segment[ hpos ];
cmpnfo[ cmp ].sfv = LBITS( segment[ hpos + 1 ], 4 );
cmpnfo[ cmp ].sfh = RBITS( segment[ hpos + 1 ], 4 );
cmpnfo[ cmp ].qtable = qtables[ segment[ hpos + 2 ] ];
if (segment[hpos + 2] >= 0 && segment[hpos + 2] < 4) {
cmpnfo[cmp].qtable = qtables[segment[hpos + 2]];
}
hpos += 3;
}