signal error on EOF in jpegload more reliably
we were only warning on EOF in the read stub, even if fail was set thanks bozaro see https://github.com/libvips/libvips/issues/1946
This commit is contained in:
parent
158e9e153a
commit
0982d0efbb
@ -2,6 +2,7 @@
|
|||||||
- don't seek on bad file descriptors [kleisauke]
|
- don't seek on bad file descriptors [kleisauke]
|
||||||
- check for null memory sources [kleisauke]
|
- check for null memory sources [kleisauke]
|
||||||
- revise ppmload, fixing a couple of small bugs
|
- revise ppmload, fixing a couple of small bugs
|
||||||
|
- signal error on EOF in jpegload more reliably [bozaro]
|
||||||
|
|
||||||
18/12/20 started 8.10.5
|
18/12/20 started 8.10.5
|
||||||
- fix potential /0 in animated webp load [lovell]
|
- fix potential /0 in animated webp load [lovell]
|
||||||
|
@ -212,6 +212,7 @@ typedef struct {
|
|||||||
|
|
||||||
/* Private stuff during read.
|
/* Private stuff during read.
|
||||||
*/
|
*/
|
||||||
|
ReadJpeg *jpeg;
|
||||||
VipsSource *source;
|
VipsSource *source;
|
||||||
unsigned char buf[SOURCE_BUFFER_SIZE];
|
unsigned char buf[SOURCE_BUFFER_SIZE];
|
||||||
|
|
||||||
@ -248,7 +249,10 @@ source_fill_input_buffer( j_decompress_ptr cinfo )
|
|||||||
src->pub.bytes_in_buffer = read;
|
src->pub.bytes_in_buffer = read;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
WARNMS( cinfo, JWRN_JPEG_EOF );
|
if( src->jpeg->fail )
|
||||||
|
ERREXIT( cinfo, JERR_INPUT_EOF );
|
||||||
|
else
|
||||||
|
WARNMS( cinfo, JWRN_JPEG_EOF );
|
||||||
src->pub.next_input_byte = eoi_buffer;
|
src->pub.next_input_byte = eoi_buffer;
|
||||||
src->pub.bytes_in_buffer = 2;
|
src->pub.bytes_in_buffer = 2;
|
||||||
}
|
}
|
||||||
@ -294,6 +298,7 @@ readjpeg_open_input( ReadJpeg *jpeg )
|
|||||||
sizeof( Source ) );
|
sizeof( Source ) );
|
||||||
|
|
||||||
src = (Source *) cinfo->src;
|
src = (Source *) cinfo->src;
|
||||||
|
src->jpeg = jpeg;
|
||||||
src->source = jpeg->source;
|
src->source = jpeg->source;
|
||||||
src->pub.init_source = source_init_source;
|
src->pub.init_source = source_init_source;
|
||||||
src->pub.fill_input_buffer = source_fill_input_buffer;
|
src->pub.fill_input_buffer = source_fill_input_buffer;
|
||||||
|
Loading…
Reference in New Issue
Block a user