Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
f596e5d4
Kaydet (Commit)
f596e5d4
authored
Mar 10, 2017
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
ofz#799 stop decompressing if the file is truncated
Change-Id: I4040ebbf7b21905b950f4af36012bc83aebaa320
üst
bed6a223
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
11 deletions
+16
-11
JpegReader.cxx
vcl/source/filter/jpeg/JpegReader.cxx
+3
-10
jpeg.h
vcl/source/filter/jpeg/jpeg.h
+11
-0
jpegc.cxx
vcl/source/filter/jpeg/jpegc.cxx
+2
-1
No files found.
vcl/source/filter/jpeg/JpegReader.cxx
Dosyayı görüntüle @
f596e5d4
...
...
@@ -33,15 +33,6 @@
#define JPEG_MIN_READ 512
#define BUFFER_SIZE 4096
/* Expanded data source object for stdio input */
struct
SourceManagerStruct
{
jpeg_source_mgr
pub
;
/* public fields */
SvStream
*
stream
;
/* source stream */
JOCTET
*
buffer
;
/* start of buffer */
boolean
start_of_file
;
/* have we gotten any data yet? */
};
/*
* Initialize source --- called by jpeg_read_header
* before any data is actually read.
...
...
@@ -55,6 +46,7 @@ extern "C" void init_source (j_decompress_ptr cinfo)
* This is correct behavior for reading a series of images from one source.
*/
source
->
start_of_file
=
TRUE
;
source
->
no_data_available
=
FALSE
;
}
long
StreamRead
(
SvStream
*
pStream
,
void
*
pBuffer
,
long
nBufferSize
)
...
...
@@ -89,6 +81,7 @@ extern "C" boolean fill_input_buffer (j_decompress_ptr cinfo)
if
(
!
nbytes
)
{
source
->
no_data_available
=
TRUE
;
if
(
source
->
start_of_file
)
/* Treat empty input file as fatal error */
{
ERREXIT
(
cinfo
,
JERR_INPUT_EMPTY
);
...
...
@@ -158,7 +151,7 @@ void jpeg_svstream_src (j_decompress_ptr cinfo, void* input)
(
*
cinfo
->
mem
->
alloc_small
)
(
reinterpret_cast
<
j_common_ptr
>
(
cinfo
),
JPOOL_PERMANENT
,
BUFFER_SIZE
*
sizeof
(
JOCTET
)));
}
source
=
reinterpret_cast
<
SourceManagerStruct
*>
(
cinfo
->
src
);
source
=
reinterpret_cast
<
SourceManagerStruct
*>
(
cinfo
->
src
);
source
->
pub
.
init_source
=
init_source
;
source
->
pub
.
fill_input_buffer
=
fill_input_buffer
;
source
->
pub
.
skip_input_data
=
skip_input_data
;
...
...
vcl/source/filter/jpeg/jpeg.h
Dosyayı görüntüle @
f596e5d4
...
...
@@ -34,6 +34,7 @@ namespace com { namespace sun { namespace star { namespace task {
class
JPEGReader
;
class
JPEGWriter
;
class
Size
;
class
SvStream
;
void
jpeg_svstream_src
(
j_decompress_ptr
cinfo
,
void
*
infile
);
...
...
@@ -49,6 +50,16 @@ void ReadJPEG( JPEGReader* pJPEGReader, void* pInputStream, long* pLines,
long
Transform
(
void
*
pInputStream
,
void
*
pOutputStream
,
long
nAngle
);
/* Expanded data source object for stdio input */
struct
SourceManagerStruct
{
jpeg_source_mgr
pub
;
/* public fields */
SvStream
*
stream
;
/* source stream */
JOCTET
*
buffer
;
/* start of buffer */
boolean
start_of_file
;
/* have we gotten any data yet? */
boolean
no_data_available
;
};
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
vcl/source/filter/jpeg/jpegc.cxx
Dosyayı görüntüle @
f596e5d4
...
...
@@ -84,6 +84,7 @@ void ReadJPEG( JPEGReader* pJPEGReader, void* pInputStream, long* pLines,
jpeg_create_decompress
(
&
cinfo
);
jpeg_svstream_src
(
&
cinfo
,
pInputStream
);
SourceManagerStruct
*
source
=
reinterpret_cast
<
SourceManagerStruct
*>
(
cinfo
.
src
);
jpeg_read_header
(
&
cinfo
,
TRUE
);
cinfo
.
scale_num
=
1
;
...
...
@@ -190,7 +191,7 @@ void ReadJPEG( JPEGReader* pJPEGReader, void* pInputStream, long* pLines,
}
}
for
(
*
pLines
=
0
;
*
pLines
<
nHeight
;
(
*
pLines
)
++
)
for
(
*
pLines
=
0
;
*
pLines
<
nHeight
&&
!
source
->
no_data_available
;
(
*
pLines
)
++
)
{
size_t
yIndex
=
*
pLines
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment