1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

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: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2015-05-17 19:08:38 +02:00
parent c720b9ce98
commit 14c4b25158

View File

@ -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,
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);
}
@ -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,
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);
}