]> granicus.if.org Git - libjpeg-turbo/commit
Fix a couple of issues with return value checking. JFREAD(), which wraps fread(...
authorDRC <dcommander@users.sourceforge.net>
Sat, 12 Oct 2013 21:52:48 +0000 (21:52 +0000)
committerDRC <dcommander@users.sourceforge.net>
Sat, 12 Oct 2013 21:52:48 +0000 (21:52 +0000)
commitc45653e471c496af8bf3c91c70c7ae4e207158c4
tree44a35b45fc49357d57fed0e141a81dd584bcf803
parenta6ef282a49f2d7d1b4d19cc89f63e81fd66b35b7
Fix a couple of issues with return value checking.  JFREAD(), which wraps fread(), will never return -1.  fread() will instead return 0 or a short object count if an error occurs, and ferror() will return 1 in that case.  The second issue was that we were assigning the return value of ftell() to an unsigned long prior to checking the value, so the value would never be < 0 if an error occurred.  It would instead be (unsigned long)-1.

git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.3.x@1061 632fc199-4ca6-4c93-a231-07263d6284db
djpeg.c
tjbench.c