From c51c08e0e70c186971385bdbb225f69edd4e3375 Mon Sep 17 00:00:00 2001 From: Mark Harris Date: Mon, 28 Dec 2015 23:04:08 -0800 Subject: avcodec: Use get_ue_golomb_long() when needed get_ue_golomb() cannot decode values larger than 8190 (the maximum value that can be golomb encoded in 25 bits) and produces the error "Invalid UE golomb code" if a larger value is encountered. Use get_ue_golomb_long() instead (which supports 63 bits, up to 4294967294) when valid h264/hevc values can exceed 8190. This updates decoding of the following values: (maximum) first_mb_in_slice 36863* for level 5.2 abs_diff_pic_num_minus1 131071 difference_of_pic_nums_minus1 131071 idr_pic_id 65535 recovery_frame_cnt 65535 frame_packing_arrangement_id 4294967294 frame_packing_arrangement_repetition_period 16384 display_orientation_repetition_period 16384 An alternative would be to modify get_ue_golomb() to handle encoded values of up to 49 bits as was done for get_se_golomb() in a92816c. In that case get_ue_golomb() could continue to be used for all of these except frame_packing_arrangement_id. Signed-off-by: Michael Niedermayer --- libavcodec/golomb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libavcodec/golomb.h') diff --git a/libavcodec/golomb.h b/libavcodec/golomb.h index 5136a04845..d4df0b39c0 100644 --- a/libavcodec/golomb.h +++ b/libavcodec/golomb.h @@ -48,7 +48,7 @@ extern const int8_t ff_interleaved_se_golomb_vlc_code[256]; extern const uint8_t ff_interleaved_dirac_golomb_vlc_code[256]; /** - * read unsigned exp golomb code. + * Read an unsigned Exp-Golomb code in the range 0 to 8190. */ static inline int get_ue_golomb(GetBitContext *gb) { -- cgit v1.2.3