From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 719CB40285 for ; Thu, 20 Jan 2022 22:14:28 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id F3F1068B22C; Fri, 21 Jan 2022 00:14:26 +0200 (EET) Received: from mx.sdf.org (mx.sdf.org [205.166.94.24]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 75AA168B0B7 for ; Fri, 21 Jan 2022 00:14:20 +0200 (EET) Received: from f0b13fde3b442eed7d21db83966c973e ([1.152.190.132]) (authenticated (0 bits)) by mx.sdf.org (8.15.2/8.14.5) with ESMTPSA id 20KME9MZ021925 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO) for ; Thu, 20 Jan 2022 22:14:13 GMT Date: Fri, 21 Jan 2022 09:14:05 +1100 From: Peter Ross To: ffmpeg-devel@ffmpeg.org Message-ID: MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avformat/img2dec: fix logic error in GEM Raster file probe X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: multipart/mixed; boundary="===============8799923112618077384==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============8799923112618077384== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="1NfrPXS9DUv9T1+1" Content-Disposition: inline --1NfrPXS9DUv9T1+1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Use correct logic to express limits of the planes and pattern_size fields. Fix ticket# 9605 Signed-off-by: Peter Ross --- libavformat/img2dec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c index 4d5ac51b53..2583ca2465 100644 --- a/libavformat/img2dec.c +++ b/libavformat/img2dec.c @@ -1115,8 +1115,8 @@ static int gem_probe(const AVProbeData *p) int ret =3D 0; if ( AV_RB16(b ) >=3D 1 && AV_RB16(b ) <=3D 3 && AV_RB16(b + 2) >=3D 8 && AV_RB16(b + 2) <=3D 779 && - (AV_RB16(b + 4) > 0 || AV_RB16(b + 4) <=3D 8) && - (AV_RB16(b + 6) > 0 || AV_RB16(b + 6) <=3D 8) && + (AV_RB16(b + 4) > 0 && AV_RB16(b + 4) <=3D 32) && /* planes */ + (AV_RB16(b + 6) > 0 && AV_RB16(b + 6) <=3D 8) && /* pattern_size= */ AV_RB16(b + 8) && AV_RB16(b + 10) && AV_RB16(b + 12) && --=20 2.34.1 -- Peter (A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B) --1NfrPXS9DUv9T1+1 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQSpB+AvpuUM0jTNINJnYHnFrEDdawUCYeneqQAKCRBnYHnFrEDd a+L8AJ9oQhSah6flgbS0ki3Tw/p+0GVbNwCcDV60AcJZEmdvJps5b2Rb1nPQKBI= =g4Kk -----END PGP SIGNATURE----- --1NfrPXS9DUv9T1+1-- --===============8799923112618077384== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". --===============8799923112618077384==--