diff --git a/libavcodec/cabac.h b/libavcodec/cabac.h
index a49e15631609d28d320ab1253e98773a79660bcb..852d47ebe8c3b899c890d47ea6e5be309d458e2c 100644
--- a/libavcodec/cabac.h
+++ b/libavcodec/cabac.h
@@ -165,7 +165,7 @@ static inline int put_cabac_terminate(CABACContext *c, int bit){
     c->symCount++;
 #endif
 
-    return (get_bit_count(&c->pb)+7)>>3;
+    return (put_bits_count(&c->pb)+7)>>3;
 }
 
 /**