Commit 14c4b251 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/golomb: fix reading huge signed rice golomb values

No testcase is known, nor any case where such huge values would occur
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent c720b9ce
...@@ -367,7 +367,7 @@ static inline int get_ur_golomb_jpegls(GetBitContext *gb, int k, int limit, ...@@ -367,7 +367,7 @@ static inline int get_ur_golomb_jpegls(GetBitContext *gb, int k, int limit,
static inline int get_sr_golomb(GetBitContext *gb, int k, int limit, static inline int get_sr_golomb(GetBitContext *gb, int k, int limit,
int esc_len) int esc_len)
{ {
int v = get_ur_golomb(gb, k, limit, esc_len); unsigned v = get_ur_golomb(gb, k, limit, esc_len);
return (v >> 1) ^ -(v & 1); return (v >> 1) ^ -(v & 1);
} }
...@@ -377,7 +377,7 @@ static inline int get_sr_golomb(GetBitContext *gb, int k, int limit, ...@@ -377,7 +377,7 @@ static inline int get_sr_golomb(GetBitContext *gb, int k, int limit,
static inline int get_sr_golomb_flac(GetBitContext *gb, int k, int limit, static inline int get_sr_golomb_flac(GetBitContext *gb, int k, int limit,
int esc_len) int esc_len)
{ {
int v = get_ur_golomb_jpegls(gb, k, limit, esc_len); unsigned v = get_ur_golomb_jpegls(gb, k, limit, esc_len);
return (v >> 1) ^ -(v & 1); return (v >> 1) ^ -(v & 1);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment