Skip to content

Commit 0561789

Browse files
stellawuintelXinfengZhang
authored andcommitted
Add Scan Num limitation
Signed-off-by: Wu, Stella <[email protected]>
1 parent ffc0b0d commit 0561789

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

decode/tinyjpeg.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -816,6 +816,8 @@ int tinyjpeg_decode(struct jdec_private *priv)
816816
vaDestroyConfig(va_dpy, config_id);
817817
vaDestroyContext(va_dpy, context_id);
818818

819+
if (scan_num > JPEG_SCAN_MAX)
820+
break;
819821
parse_JFIF(priv, priv->stream);
820822
if (priv->width[scan_num] == 0 && priv->height[scan_num] == 0)
821823
break;

0 commit comments

Comments
 (0)