aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/h264_ps.c
diff options
context:
space:
mode:
authorMans Rullgard <mans@mansr.com>2011-10-11 16:00:21 +0100
committerMans Rullgard <mans@mansr.com>2011-10-11 18:24:51 +0100
commitfdba370f8a1bdfc22ecbdf3c7148c2f8680a4ac4 (patch)
treef908af97621bbf687b604b722a0d9f16239a02ab /libavcodec/h264_ps.c
parent91f4732913f657f426f2707c45b9026e12b04eb2 (diff)
downloadffmpeg-fdba370f8a1bdfc22ecbdf3c7148c2f8680a4ac4.tar.gz
h264: fix HRD parameters parsing
The bit_rate_value_minus1 and cpb_size_value_minus1 elements allow a wider range than get_ue_golomb() supports. This adds a get_ue_golomb_long() function supporting up to 31 leading zeros, which is the maximum for these syntax elements, and uses it in decode_hrd_parameters(). Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'libavcodec/h264_ps.c')
-rw-r--r--libavcodec/h264_ps.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c
index bb673e9d4e..677ca80abb 100644
--- a/libavcodec/h264_ps.c
+++ b/libavcodec/h264_ps.c
@@ -130,8 +130,8 @@ static inline int decode_hrd_parameters(H264Context *h, SPS *sps){
get_bits(&s->gb, 4); /* bit_rate_scale */
get_bits(&s->gb, 4); /* cpb_size_scale */
for(i=0; i<cpb_count; i++){
- get_ue_golomb(&s->gb); /* bit_rate_value_minus1 */
- get_ue_golomb(&s->gb); /* cpb_size_value_minus1 */
+ get_ue_golomb_long(&s->gb); /* bit_rate_value_minus1 */
+ get_ue_golomb_long(&s->gb); /* cpb_size_value_minus1 */
get_bits1(&s->gb); /* cbr_flag */
}
sps->initial_cpb_removal_delay_length = get_bits(&s->gb, 5) + 1;