diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2019-10-06 07:01:13 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2019-10-07 22:27:18 +0200 |
commit | 5e546864b09379910721b35a14713982d933d9dd (patch) | |
tree | 5b88e5ae87a2c514048b48abb9116623b33c48bf /libavcodec/flac_parser.c | |
parent | 69dd8d3a2a3d82ada344c889cbf8a8837a9157a0 (diff) |
avcodec/flac_parser: Use native endianness when possible
FLAC sync codes contain a byte equal to 0xFF and so the function that
searches for sync codes first searched for this byte. It did this by
checking four bytes at once; these bytes have been read via AV_RB32, but
the test works just as well with native endianness.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/flac_parser.c')
-rw-r--r-- | libavcodec/flac_parser.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/flac_parser.c b/libavcodec/flac_parser.c index 2721286464..5d0705ce63 100644 --- a/libavcodec/flac_parser.c +++ b/libavcodec/flac_parser.c @@ -221,7 +221,7 @@ static int find_headers_search(FLACParseContext *fpc, uint8_t *buf, int buf_size } for (; i < buf_size - 1; i += 4) { - x = AV_RB32(buf + i); + x = AV_RN32(buf + i); if (((x & ~(x + 0x01010101)) & 0x80808080)) { for (j = 0; j < 4; j++) { if ((AV_RB16(buf + i + j) & 0xFFFE) == 0xFFF8) |