metadata/mp3data.c set data to 0 in case of read error

Change-Id: I15d4e3d3be4bf4531c892f4351355b0b2e8e0ca9
This commit is contained in:
William Wilgus 2021-08-06 20:53:30 -04:00
parent 2008b7d1b0
commit 8a8fd3d4a3

View file

@ -215,10 +215,9 @@ static bool headers_have_same_type(unsigned long header1,
/* Helper function to read 4-byte in big endian format. */
static void read_uint32be_mp3data(int fd, unsigned long *data)
{
#ifdef ROCKBOX_BIG_ENDIAN
(void)read(fd, (char*)data, 4);
#else
*data = 0;
(void)read(fd, (char*)data, 4);
#ifndef ROCKBOX_BIG_ENDIAN
*data = betoh32(*data);
#endif
}