mirror of
https://github.com/Bodmer/JPEGDecoder.git
synced 2025-05-17 23:15:57 +08:00
Clear parameters and return 0 for failed decode - issue #28
This commit is contained in:
@ -407,6 +407,15 @@ int JPEGDecoder::decodeArray(const uint8_t array[], uint32_t array_size) {
|
|||||||
|
|
||||||
int JPEGDecoder::decodeCommon(void) {
|
int JPEGDecoder::decodeCommon(void) {
|
||||||
|
|
||||||
|
width = 0;
|
||||||
|
height = 0;
|
||||||
|
comps = 0;
|
||||||
|
MCUSPerRow = 0;
|
||||||
|
MCUSPerCol = 0;
|
||||||
|
scanType = (pjpeg_scan_type_t)0;
|
||||||
|
MCUWidth = 0;
|
||||||
|
MCUHeight = 0;
|
||||||
|
|
||||||
status = pjpeg_decode_init(&image_info, pjpeg_callback, NULL, 0);
|
status = pjpeg_decode_init(&image_info, pjpeg_callback, NULL, 0);
|
||||||
|
|
||||||
if (status) {
|
if (status) {
|
||||||
@ -419,7 +428,7 @@ int JPEGDecoder::decodeCommon(void) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return -1;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
decoded_width = image_info.m_width;
|
decoded_width = image_info.m_width;
|
||||||
|
Reference in New Issue
Block a user