diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c
index 0aea9757b7..8da57ec80a 100644
--- a/libavcodec/cavsdec.c
+++ b/libavcodec/cavsdec.c
@@ -502,7 +502,7 @@ static inline void mv_pred_sym(AVSContext *h, cavs_vector *src,
 /** kth-order exponential golomb code */
 static inline int get_ue_code(GetBitContext *gb, int order)
 {
-    unsigned ret = get_ue_golomb(gb);
+    unsigned ret = get_ue_golomb2(gb);
     if (ret >= ((1U<<31)>>order)) {
         av_log(NULL, AV_LOG_ERROR, "get_ue_code: value too larger\n");
         return AVERROR_INVALIDDATA;
@@ -613,7 +613,7 @@ static inline int decode_residual_inter(AVSContext *h)
     int block;
 
     /* get coded block pattern */
-    int cbp = get_ue_golomb(&h->gb);
+    int cbp = get_ue_golomb2(&h->gb);
     if (cbp > 63U) {
         av_log(h->avctx, AV_LOG_ERROR, "Inter cbp not in 0-63 range\n");
         return AVERROR_INVALIDDATA;
@@ -685,7 +685,7 @@ static int decode_mb_i(AVSContext *h, int cbp_code)
 
     /* get coded block pattern */
     if (h->cur.f->pict_type == AV_PICTURE_TYPE_I)
-        cbp_code = get_ue_golomb(gb);
+        cbp_code = get_ue_golomb2(gb);
     if (cbp_code > 63U) {
         av_log(h->avctx, AV_LOG_ERROR, "illegal intra cbp\n");
         return AVERROR_INVALIDDATA;
diff --git a/libavcodec/h264_cavlc.c b/libavcodec/h264_cavlc.c
index c4b14d2578..3dcb82c71c 100644
--- a/libavcodec/h264_cavlc.c
+++ b/libavcodec/h264_cavlc.c
@@ -739,7 +739,7 @@ int ff_h264_decode_mb_cavlc(const H264Context *h, H264SliceContext *sl)
 
     sl->prev_mb_skipped = 0;
 
-    mb_type= get_ue_golomb(&sl->gb);
+    mb_type = get_ue_golomb2(&sl->gb);
     if (sl->slice_type_nos == AV_PICTURE_TYPE_B) {
         if(mb_type < 23){
             partition_count = ff_h264_b_mb_type_info[mb_type].partition_count;
@@ -1067,7 +1067,7 @@ decode_intra_mb:
         write_back_motion(h, sl, mb_type);
 
     if(!IS_INTRA16x16(mb_type)){
-        cbp= get_ue_golomb(&sl->gb);
+        cbp = get_ue_golomb2(&sl->gb);
 
         if(decode_chroma){
             if(cbp > 47){
diff --git a/libavcodec/h264_parse.c b/libavcodec/h264_parse.c
index fd9b824756..11ae20a32a 100644
--- a/libavcodec/h264_parse.c
+++ b/libavcodec/h264_parse.c
@@ -234,9 +234,9 @@ int ff_h264_parse_ref_count(int *plist_count, int ref_count[2],
         num_ref_idx_active_override_flag = get_bits1(gb);
 
         if (num_ref_idx_active_override_flag) {
-            ref_count[0] = get_ue_golomb(gb) + 1;
+            ref_count[0] = get_ue_golomb2(gb) + 1;
             if (slice_type_nos == AV_PICTURE_TYPE_B) {
-                ref_count[1] = get_ue_golomb(gb) + 1;
+                ref_count[1] = get_ue_golomb2(gb) + 1;
             } else
                 // full range is spec-ok in this case, even for frames
                 ref_count[1] = 1;
diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c
index 3b62567245..d5bf80a89a 100644
--- a/libavcodec/h264_parser.c
+++ b/libavcodec/h264_parser.c
@@ -348,7 +348,7 @@ static inline int parse_nal_units(AVCodecParserContext *s,
                 /* key frame, since recovery_frame_cnt is set */
                 s->key_frame = 1;
             }
-            pps_id = get_ue_golomb(&nal.gb);
+            pps_id = get_ue_golomb2(&nal.gb);
             if (pps_id >= MAX_PPS_COUNT) {
                 av_log(avctx, AV_LOG_ERROR,
                        "pps_id not in 0-255 range\n");
diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c
index 18e5d9578f..9f0d07810b 100644
--- a/libavcodec/h264_ps.c
+++ b/libavcodec/h264_ps.c
@@ -459,7 +459,7 @@ int ff_h264_decode_seq_parameter_set(GetBitContext *gb, AVCodecContext *avctx,
             goto fail;
         }
 
-        sps->poc_cycle_length                 = get_ue_golomb(gb);
+        sps->poc_cycle_length                 = get_ue_golomb2(gb);
 
         if ((unsigned)sps->poc_cycle_length >=
             FF_ARRAY_ELEMS(sps->offset_for_ref_frame)) {
@@ -750,7 +750,7 @@ int ff_h264_decode_picture_parameter_set(GetBitContext *gb, AVCodecContext *avct
 {
     AVBufferRef *pps_buf;
     const SPS *sps;
-    unsigned int pps_id = get_ue_golomb(gb);
+    unsigned int pps_id = get_ue_golomb2(gb);
     PPS *pps;
     int qp_bd_offset;
     int bits_left;
@@ -821,8 +821,8 @@ int ff_h264_decode_picture_parameter_set(GetBitContext *gb, AVCodecContext *avct
         ret = AVERROR_PATCHWELCOME;
         goto fail;
     }
-    pps->ref_count[0] = get_ue_golomb(gb) + 1;
-    pps->ref_count[1] = get_ue_golomb(gb) + 1;
+    pps->ref_count[0] = get_ue_golomb2(gb) + 1;
+    pps->ref_count[1] = get_ue_golomb2(gb) + 1;
     if (pps->ref_count[0] - 1 > 32 - 1 || pps->ref_count[1] - 1 > 32 - 1) {
         av_log(avctx, AV_LOG_ERROR, "reference overflow (pps)\n");
         ret = AVERROR_INVALIDDATA;
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 29b57bc305..fab8cbc839 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1762,7 +1762,7 @@ static int h264_slice_header_parse(const H264Context *h, H264SliceContext *sl,
         return AVERROR_INVALIDDATA;
     }
 
-    sl->pps_id = get_ue_golomb(&sl->gb);
+    sl->pps_id = get_ue_golomb2(&sl->gb);
     if (sl->pps_id >= MAX_PPS_COUNT) {
         av_log(h->avctx, AV_LOG_ERROR, "pps_id not in 0-255 range\n");
         return AVERROR_INVALIDDATA;
