From 863a6388b4d00ad594767313b26736bc451e0b2b Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sun, 10 Jul 2016 18:14:58 +0200 Subject: [PATCH] JPEG translator: fix warnings and enable Werror Using setjmp and modifying local variables in the same function is not allowed. Fixes #12653. --- src/add-ons/translators/jpeg/JPEGTranslator.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/add-ons/translators/jpeg/JPEGTranslator.cpp b/src/add-ons/translators/jpeg/JPEGTranslator.cpp index e9b296dd4c..366c5ad8ab 100644 --- a/src/add-ons/translators/jpeg/JPEGTranslator.cpp +++ b/src/add-ons/translators/jpeg/JPEGTranslator.cpp @@ -764,10 +764,6 @@ JPEGTranslator::DerivedTranslate(BPositionIO* inSource, const translator_info* inInfo, BMessage* ioExtension, uint32 outType, BPositionIO* outDestination, int32 baseType) { - // If no specific type was requested, convert to the interchange format - if (outType == 0) - outType = B_TRANSLATOR_BITMAP; - // Setup a "breakpoint" since throwing exceptions does not seem to work // at all in an add-on. (?) // In the be_jerror.cpp we implement a handler for critical library errors @@ -788,7 +784,8 @@ JPEGTranslator::DerivedTranslate(BPositionIO* inSource, && outType == JPEG_FORMAT) { return Compress(inSource, outDestination, &longJumpBuffer); } else if (inInfo->type == JPEG_FORMAT - && outType == B_TRANSLATOR_BITMAP) { + && (outType == B_TRANSLATOR_BITMAP || outType == 0)) { + // This is the default if no specific outType was requested. return Decompress(inSource, outDestination, ioExtension, &longJumpBuffer); }