avformat/img2dec: fix logic error in GEM Raster file probe

Use correct logic to express limits of the planes and pattern_size fields.

Fix ticket# 9605

Signed-off-by: Peter Ross <pross@xvid.org>
release/5.1
Peter Ross 3 years ago
parent c69b1a12bb
commit 5903a4e321
  1. 4
      libavformat/img2dec.c

@ -1115,8 +1115,8 @@ static int gem_probe(const AVProbeData *p)
int ret = 0;
if ( AV_RB16(b ) >= 1 && AV_RB16(b ) <= 3 &&
AV_RB16(b + 2) >= 8 && AV_RB16(b + 2) <= 779 &&
(AV_RB16(b + 4) > 0 || AV_RB16(b + 4) <= 8) &&
(AV_RB16(b + 6) > 0 || AV_RB16(b + 6) <= 8) &&
(AV_RB16(b + 4) > 0 && AV_RB16(b + 4) <= 32) && /* planes */
(AV_RB16(b + 6) > 0 && AV_RB16(b + 6) <= 8) && /* pattern_size */
AV_RB16(b + 8) &&
AV_RB16(b + 10) &&
AV_RB16(b + 12) &&

Loading…
Cancel
Save