libFLAC/bitwriter.c: Fix undefined behaviour
authorErik de Castro Lopo <erikd@mega-nerd.com>
Sun, 30 Aug 2015 13:54:33 +0000 (23:54 +1000)
committerErik de Castro Lopo <erikd@mega-nerd.com>
Sun, 30 Aug 2015 14:22:12 +0000 (00:22 +1000)
src/libFLAC/bitwriter.c

index dcdd93e..8d3f6ac 100644 (file)
@@ -184,7 +184,7 @@ void FLAC__bitwriter_dump(const FLAC__BitWriter *bw, FILE *out)
                for(i = 0; i < bw->words; i++) {
                        fprintf(out, "%08X: ", i);
                        for(j = 0; j < FLAC__BITS_PER_WORD; j++)
-                               fprintf(out, "%01u", bw->buffer[i] & (1 << (FLAC__BITS_PER_WORD-j-1)) ? 1:0);
+                               fprintf(out, "%01u", bw->buffer[i] & (1u << (FLAC__BITS_PER_WORD-j-1)) ? 1:0);
                        fprintf(out, "\n");
                }
                if(bw->bits > 0) {