libavutil: cast truncated values to uint32_t