From 9d5909e2cb3796fc9224e1762eb85318f4a31b7a Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Wed, 17 Jan 2018 21:30:56 +0000 Subject: Remove param checking from StartScanLine By catching this early we are now actually returning the wrong value. The bad value should be passed into the jpeg library code, which will cause a fatal error and jump out to the common error handling code for this method. BUG=pdfium:986 Change-Id: Ib3d32939aa38aece887c014c3a477407ee178193 Reviewed-on: https://pdfium-review.googlesource.com/23119 Commit-Queue: Ryan Harrison Reviewed-by: dsinclair --- core/fxcodec/codec/fx_codec_jpeg.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/core/fxcodec/codec/fx_codec_jpeg.cpp b/core/fxcodec/codec/fx_codec_jpeg.cpp index cf501a99d1..6e227ca20e 100644 --- a/core/fxcodec/codec/fx_codec_jpeg.cpp +++ b/core/fxcodec/codec/fx_codec_jpeg.cpp @@ -475,9 +475,6 @@ int CCodec_JpegModule::ReadHeader(Context* pContext, } bool CCodec_JpegModule::StartScanline(Context* pContext, int down_scale) { - if (down_scale < 0) - return false; - auto* ctx = static_cast(pContext); ctx->m_Info.scale_denom = static_cast(down_scale); return !!jpeg_start_decompress(&ctx->m_Info); -- cgit v1.2.3