Skip to content
Permalink
Browse files Browse the repository at this point in the history
Fixed div0 vulnerability in SampFact
  • Loading branch information
ImpulseAdventure committed Jun 6, 2017
1 parent fa2bb27 commit b4e4586
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions JfifDecode.cpp
@@ -1,5 +1,5 @@
// JPEGsnoop - JPEG Image Decoder & Analysis Utility
// Copyright (C) 2015 - Calvin Hass
// Copyright (C) 2017 - Calvin Hass
// http://www.impulseadventure.com/photo/jpeg-snoop.html
//
// This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -4903,8 +4903,8 @@ unsigned CjfifDecode::DecodeMarker()
// possibility of div by 0).
m_anSofHorzSampFact_Hi[nCompIdent] = (anSofSampFact[nCompIdent] & 0xF0) >> 4; // Hi, range 1..4
m_anSofVertSampFact_Vi[nCompIdent] = (anSofSampFact[nCompIdent] & 0x0F); // Vi, range 1..4
//if (!ValidateValue(m_anSofHorzSampFact_Hi[nCompIdent],1,4,_T("Horizontal Sampling Factor <Hi>"),true,1)) return DECMARK_ERR;
//if (!ValidateValue(m_anSofVertSampFact_Vi[nCompIdent],1,4,_T("Vertical Sampling Factor <Vi>"),true,1)) return DECMARK_ERR;
if (!ValidateValue(m_anSofHorzSampFact_Hi[nCompIdent],1,4,_T("Horizontal Sampling Factor <Hi>"),true,1)) return DECMARK_ERR;
if (!ValidateValue(m_anSofVertSampFact_Vi[nCompIdent],1,4,_T("Vertical Sampling Factor <Vi>"),true,1)) return DECMARK_ERR;

}

Expand Down

0 comments on commit b4e4586

Please sign in to comment.