Skip to content

Commit

Permalink
avformat/mpc8: Use uint64_t in *_get_v() to avoid undefined behavior
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Niedermayer <[email protected]>
(cherry picked from commit 05e1619)

Signed-off-by: Michael Niedermayer <[email protected]>
  • Loading branch information
michaelni committed Mar 13, 2015
1 parent 21ebfcd commit 485f78b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libavformat/mpc8.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ typedef struct {

static inline int64_t bs_get_v(const uint8_t **bs)
{
int64_t v = 0;
uint64_t v = 0;
int br = 0;
int c;

Expand Down Expand Up @@ -108,7 +108,7 @@ static int mpc8_probe(AVProbeData *p)

static inline int64_t gb_get_v(GetBitContext *gb)
{
int64_t v = 0;
uint64_t v = 0;
int bits = 0;
while(get_bits1(gb) && bits < 64-7){
v <<= 7;
Expand Down

0 comments on commit 485f78b

Please sign in to comment.