Ensure that tjDecompress2() exits cleanly if setDecompDefaults() fails

git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@822 632fc199-4ca6-4c93-a231-07263d6284db
This commit is contained in:
DRC
2012-03-23 19:37:40 +00:00

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C)2009-2011 D. R. Commander. All Rights Reserved.
* Copyright (C)2009-2012 D. R. Commander. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -768,7 +768,10 @@ DLLEXPORT int DLLCALL tjDecompress2(tjhandle handle, unsigned char *jpegBuf,
jpeg_mem_src_tj(dinfo, jpegBuf, jpegSize);
jpeg_read_header(dinfo, TRUE);
if(setDecompDefaults(dinfo, pixelFormat)==-1) return -1;
if(setDecompDefaults(dinfo, pixelFormat)==-1)
{
retval=-1; goto bailout;
}
if(flags&TJFLAG_FASTUPSAMPLE) dinfo->do_fancy_upsampling=FALSE;