Browse Source

avcodec/bitstream: Don't check for undefined behaviour after it happened

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
(cherry picked from commit 5e196dac22)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
tags/n4.3.1
Andreas Rheinhardt 4 years ago
parent
commit
284fffa92f
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavcodec/bitstream.c

+ 1
- 1
libavcodec/bitstream.c View File

@@ -162,9 +162,9 @@ static int build_table(VLC *vlc, int table_nb_bits, int nb_codes,
uint32_t code; uint32_t code;
volatile VLC_TYPE (* volatile table)[2]; // the double volatile is needed to prevent an internal compiler error in gcc 4.2 volatile VLC_TYPE (* volatile table)[2]; // the double volatile is needed to prevent an internal compiler error in gcc 4.2


table_size = 1 << table_nb_bits;
if (table_nb_bits > 30) if (table_nb_bits > 30)
return AVERROR(EINVAL); return AVERROR(EINVAL);
table_size = 1 << table_nb_bits;
table_index = alloc_table(vlc, table_size, flags & INIT_VLC_USE_NEW_STATIC); table_index = alloc_table(vlc, table_size, flags & INIT_VLC_USE_NEW_STATIC);
ff_dlog(NULL, "new table index=%d size=%d\n", table_index, table_size); ff_dlog(NULL, "new table index=%d size=%d\n", table_index, table_size);
if (table_index < 0) if (table_index < 0)


Loading…
Cancel
Save