]> git.sesse.net Git - fjl/blobdiff - driver.c
Let the bit source alert about EOF as soon as we have started eating into padding...
[fjl] / driver.c
index aa803d6ed00aa67266495b65df93e6582bc89151..35934da1d72d711efafdb588b62dae22cdcd8e54 100644 (file)
--- a/driver.c
+++ b/driver.c
@@ -151,7 +151,7 @@ void read_scan(struct byte_source* source, struct jpeg_image* image, huffman_tab
                
        unsigned mcu_x = 0, mcu_y = 0;
 
-       for ( ;; ) {
+       while (!bits.source_eof) {
                for (unsigned c = 0; c < num_components; ++c) {
                        unsigned cn = component_num[c];
                        unsigned stride = image->num_blocks_horizontal * image->hsample[cn] * DCTSIZE;