]> granicus.if.org Git - libjpeg-turbo/commitdiff
Don't call jpeg_finish_compress() with YUV output, because it tries to insert an...
authorDRC <dcommander@users.sourceforge.net>
Tue, 1 Mar 2011 08:18:30 +0000 (08:18 +0000)
committerDRC <dcommander@users.sourceforge.net>
Tue, 1 Mar 2011 08:18:30 +0000 (08:18 +0000)
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/branches/1.1.x@475 632fc199-4ca6-4c93-a231-07263d6284db

ChangeLog.txt
jpegut.c
turbojpegl.c

index 4f0dc72ce1020dd0f14053556e3a4ca95638cbd7..fb92532b4458ed4033fa0fe0c83510a516d59f63 100644 (file)
@@ -1,3 +1,10 @@
+1.1.1
+=====
+
+[1] Fixed a 1-pixel error in row 0, column 21 of the luminance plane generated
+by tjEncodeYUV().
+
+
 1.1.0
 =====
 
index 1be8bc1d506449a81aea9f77fc6189c763f54e21..3bbcb898f1f66fc761325715a77d361279c750f7 100644 (file)
--- a/jpegut.c
+++ b/jpegut.c
@@ -219,7 +219,7 @@ int checkbuf(unsigned char *buf, int w, int h, int ps, int subsamp, int flags)
        }}
 
 #define checkval255(v) { \
-       if(v<254 && !(v==217 && i==0 && j==21)) { \
+       if(v<254) { \
                printf("\nComp. %s at %d,%d should be 255, not %d\n", #v, i, j, v); \
                retval=0;  goto bailout; \
        }}
index 8e3f2b09a158f1fb5379b8c9c7f988c2347610d3..5cc543743f38127faa64c5ce22aa815159392611 100644 (file)
@@ -300,6 +300,7 @@ DLLEXPORT int DLLCALL tjCompress(tjhandle h,
                }
                *size=yuvsize;
                cinfo->next_scanline+=height;
+               jpeg_abort_compress(&j->cinfo);
        }
        else
        {
@@ -315,11 +316,10 @@ DLLEXPORT int DLLCALL tjCompress(tjhandle h,
                        jpeg_write_scanlines(&j->cinfo, &row_pointer[j->cinfo.next_scanline],
                                j->cinfo.image_height-j->cinfo.next_scanline);
                }
-       }
-       jpeg_finish_compress(&j->cinfo);
-       if(!(flags&TJ_YUV))
+               jpeg_finish_compress(&j->cinfo);
                *size=TJBUFSIZE(j->cinfo.image_width, j->cinfo.image_height)
                        -(unsigned long)(j->jdms.free_in_buffer);
+       }
 
        bailout:
        if(j->cinfo.global_state>CSTATE_START) jpeg_abort_compress(&j->cinfo);