]> git.alsa-project.org Git - tinycompress.git/commitdiff
cplay: fix size and nmemb of mp3 header of fread
authorKatsuhiro Suzuki <suzuki.katsuhiro@socionext.com>
Tue, 23 Jan 2018 02:33:11 +0000 (11:33 +0900)
committerVinod Koul <vinod.koul@intel.com>
Thu, 1 Feb 2018 10:53:12 +0000 (16:23 +0530)
This patch swaps 'size' and 'nmemb' arguments of fread.
The fread returns always 1 (because 'nmemb' is 1) so checking
the return value is always failure.

Signed-off-by: Katsuhiro Suzuki <suzuki.katsuhiro@socionext.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
src/utils/cplay.c

index e0603fd9590558d04a59f353fb0994133956e82b..bc95f0d0a3a23cb7f83b873da0072d8075273974 100644 (file)
@@ -220,7 +220,7 @@ void play_samples(char *name, unsigned int card, unsigned int device,
                exit(EXIT_FAILURE);
        }
 
-       read = fread(&header, sizeof(header), 1, file);
+       read = fread(&header, 1, sizeof(header), file);
        if (read != sizeof(header)) {
                fprintf(stderr, "Unable to read header \n");
                fclose(file);