about summary refs log tree commit diff
path: root/converter/other/cameratopam/ljpeg.c
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2023-06-28 17:29:32 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2023-06-28 17:29:32 +0000
commit23ce26f64c34e30951ad9ade2151552ed77e7357 (patch)
treed73b31a0c2f7c7be4a69f8a8e84e00dd39c432b5 /converter/other/cameratopam/ljpeg.c
parent1b6e51a266008348ad93ed8b6ac9ec91b5024fea (diff)
downloadnetpbm-mirror-23ce26f64c34e30951ad9ade2151552ed77e7357.tar.gz
netpbm-mirror-23ce26f64c34e30951ad9ade2151552ed77e7357.tar.xz
netpbm-mirror-23ce26f64c34e30951ad9ade2151552ed77e7357.zip
promote Advanced to Stable
git-svn-id: http://svn.code.sf.net/p/netpbm/code/stable@4558 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'converter/other/cameratopam/ljpeg.c')
-rw-r--r--converter/other/cameratopam/ljpeg.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/converter/other/cameratopam/ljpeg.c b/converter/other/cameratopam/ljpeg.c
index 331d258c..35f50f4b 100644
--- a/converter/other/cameratopam/ljpeg.c
+++ b/converter/other/cameratopam/ljpeg.c
@@ -2,7 +2,6 @@
 #define _BSD_SOURCE    /* Make sure string.h containst strcasecmp() */
 #include <stdlib.h>
 #include <string.h>
-#include <stdio.h>
 #include <limits.h>
 
 #include "pm.h"
@@ -11,6 +10,7 @@
 #include "util.h"
 #include "decode.h"
 #include "bayer.h"
+#include "stdio_nofail.h"
 
 #include "ljpeg.h"
 
@@ -20,7 +20,7 @@
    enough to decode Canon, Kodak and Adobe DNG images.
  */
 
-int  
+int
 ljpeg_start(FILE *         const ifP,
             struct jhead * const jhP) {
 
@@ -30,12 +30,12 @@ ljpeg_start(FILE *         const ifP,
     init_decoder();
     for (i=0; i < 4; i++)
         jhP->huff[i] = free_decode;
-    fread (data, 2, 1, ifP);
+    fread_nofail (data, 2, 1, ifP);
     if (data[0] != 0xff || data[1] != 0xd8) return 0;
     do {
         unsigned int len;
 
-        fread (data, 2, 2, ifP);
+        fread_nofail (data, 2, 2, ifP);
         tag =  data[0] << 8 | data[1];
         len = data[2] << 8 | data[3];
 
@@ -45,7 +45,7 @@ ljpeg_start(FILE *         const ifP,
             unsigned int const dataLen = len - 2;
 
             if (tag <= 0xff00 || dataLen > 255) return 0;
-            fread (data, 1, dataLen, ifP);
+            fread_nofail (data, 1, dataLen, ifP);
             switch (tag) {
             case 0xffc3:
                 jhP->bits = data[0];
@@ -73,7 +73,7 @@ ljpeg_start(FILE *         const ifP,
 
 
 
-int 
+int
 ljpeg_diff(FILE *          const ifP,
            struct decode * const dindexHeadP) {
 
@@ -111,7 +111,7 @@ ljpeg_row(FILE *         const ifP,
 
 
 
-void  
+void
 lossless_jpeg_load_raw(Image  const image) {
 
     int jwide, jrow, jcol, val, jidx, i, row, col;
@@ -161,5 +161,3 @@ lossless_jpeg_load_raw(Image  const image) {
     if (!strcasecmp(make,"KODAK"))
         black = min;
 }
-
-