diff options
author | Oliver Chang <ochang@chromium.org> | 2015-11-19 19:38:38 -0800 |
---|---|---|
committer | Oliver Chang <ochang@chromium.org> | 2015-11-19 19:38:38 -0800 |
commit | 237c3653bf7235ac5cab86bb61cfbd4ed8f18f75 (patch) | |
tree | 56391b190dd71beea1c94c48a937e447f9cd8b84 /core/src/fxcodec/codec | |
parent | 44971898e73ce68f0014ff588e5556c20332cdd0 (diff) | |
download | pdfium-237c3653bf7235ac5cab86bb61cfbd4ed8f18f75.tar.xz |
Merge to XFA: Add a missing setjmp() to CCodec_JpegDecoder::v_GetNextLine().
If jpeg_read_scanlines() ends up calling the error callback, we longjmp
into some undefined state.
BUG=558840
TBR=thestig@chromium.org
Review URL: https://codereview.chromium.org/1463563003 .
(cherry picked from commit 06e33aec03f13c76d9eff5c09cb03e142b0c5ef1)
Review URL: https://codereview.chromium.org/1462253004 .
Diffstat (limited to 'core/src/fxcodec/codec')
-rw-r--r-- | core/src/fxcodec/codec/fx_codec_jpeg.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/core/src/fxcodec/codec/fx_codec_jpeg.cpp b/core/src/fxcodec/codec/fx_codec_jpeg.cpp index e8016d2ab5..c06253d785 100644 --- a/core/src/fxcodec/codec/fx_codec_jpeg.cpp +++ b/core/src/fxcodec/codec/fx_codec_jpeg.cpp @@ -491,9 +491,12 @@ FX_BOOL CCodec_JpegDecoder::v_Rewind() { return TRUE; } uint8_t* CCodec_JpegDecoder::v_GetNextLine() { + if (setjmp(m_JmpBuf) == -1) + return nullptr; + int nlines = jpeg_read_scanlines(&cinfo, &m_pScanlineBuf, 1); if (nlines < 1) { - return NULL; + return nullptr; } return m_pScanlineBuf; } |